mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 06:49:27 +02:00
* implement CThreadSwitch using sched_yield()
git-svn-id: trunk@7429 -
This commit is contained in:
parent
e2db0a3982
commit
3ab9ace8c4
@ -284,10 +284,15 @@ Type PINTRTLEvent = ^TINTRTLEvent;
|
||||
end;
|
||||
|
||||
|
||||
procedure sched_yield; cdecl; external 'c' name 'sched_yield';
|
||||
|
||||
procedure CThreadSwitch; {give time to other threads}
|
||||
begin
|
||||
{extern int pthread_yield (void) __THROW;}
|
||||
{$Warning ThreadSwitch needs to be implemented}
|
||||
{ At least on Mac OS X, the pthread_yield_np calls through to this. }
|
||||
{ Further, sched_yield is in POSIX and supported on FreeBSD 4+, }
|
||||
{ Linux, Mac OS X and Solaris, while the thread-specific yield }
|
||||
{ routines are called differently everywhere and non-standard. }
|
||||
sched_yield;
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user