mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 12:49:20 +02:00
* tthread patch from neli
This commit is contained in:
parent
49c3697fbf
commit
e12796a400
@ -248,6 +248,12 @@ begin
|
|||||||
currenttm.rtleventsetEvent(state);
|
currenttm.rtleventsetEvent(state);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure RTLeventStartWait(state:pRTLEvent);
|
||||||
|
|
||||||
|
begin
|
||||||
|
currenttm.rtleventStartWait(state);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure RTLeventWaitFor(state:pRTLEvent);
|
procedure RTLeventWaitFor(state:pRTLEvent);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -409,6 +415,12 @@ begin
|
|||||||
NoThreadError;
|
NoThreadError;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure NORTLeventStartWait(state:pRTLEvent);
|
||||||
|
|
||||||
|
begin
|
||||||
|
NoThreadError;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure NORTLeventWaitFor(state:pRTLEvent);
|
procedure NORTLeventWaitFor(state:pRTLEvent);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -467,6 +479,7 @@ begin
|
|||||||
rtlEventCreate :=@NortlEventCreate;
|
rtlEventCreate :=@NortlEventCreate;
|
||||||
rtleventdestroy :=@Nortleventdestroy;
|
rtleventdestroy :=@Nortleventdestroy;
|
||||||
rtleventSetEvent :=@NortleventSetEvent;
|
rtleventSetEvent :=@NortleventSetEvent;
|
||||||
|
rtleventStartWait :=@NortleventStartWait;
|
||||||
rtleventWaitFor :=@NortleventWaitFor;
|
rtleventWaitFor :=@NortleventWaitFor;
|
||||||
rtleventsync :=@Nortleventsync;
|
rtleventsync :=@Nortleventsync;
|
||||||
rtlchksyncunix :=@nortlchksyncunix;
|
rtlchksyncunix :=@nortlchksyncunix;
|
||||||
@ -477,7 +490,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.16 2004-12-27 15:28:40 marco
|
Revision 1.17 2004-12-28 14:20:03 marco
|
||||||
|
* tthread patch from neli
|
||||||
|
|
||||||
|
Revision 1.16 2004/12/27 15:28:40 marco
|
||||||
* checksynchronize now in interface win32 uses the default impl.
|
* checksynchronize now in interface win32 uses the default impl.
|
||||||
unix uses systhrds, rest empty implementation.
|
unix uses systhrds, rest empty implementation.
|
||||||
|
|
||||||
|
@ -78,7 +78,8 @@ type
|
|||||||
RTLEventCreate : TRTLCreateEventHandler;
|
RTLEventCreate : TRTLCreateEventHandler;
|
||||||
RTLEventDestroy : TRTLEventHandler;
|
RTLEventDestroy : TRTLEventHandler;
|
||||||
RTLEventSetEvent : TRTLEventHandler;
|
RTLEventSetEvent : TRTLEventHandler;
|
||||||
RTLeventWaitFOr : TRTLEventHandler;
|
RTLEventStartWait : TRTLEventHandler;
|
||||||
|
RTLEventWaitFor : TRTLEventHandler;
|
||||||
RTLEventSync : TRTLEventSyncHandler;
|
RTLEventSync : TRTLEventSyncHandler;
|
||||||
RTLChkSyncUnix : TRTLCheckSyncUnixHandler;
|
RTLChkSyncUnix : TRTLCheckSyncUnixHandler;
|
||||||
end;
|
end;
|
||||||
@ -158,13 +159,17 @@ function basiceventWaitFor(Timeout : Cardinal;state:peventstate) : longint;
|
|||||||
function RTLEventCreate :PRTLEvent;
|
function RTLEventCreate :PRTLEvent;
|
||||||
procedure RTLeventdestroy(state:pRTLEvent);
|
procedure RTLeventdestroy(state:pRTLEvent);
|
||||||
procedure RTLeventSetEvent(state:pRTLEvent);
|
procedure RTLeventSetEvent(state:pRTLEvent);
|
||||||
|
procedure RTLeventStartWait(state:pRTLEvent);
|
||||||
procedure RTLeventWaitFor(state:pRTLEvent);
|
procedure RTLeventWaitFor(state:pRTLEvent);
|
||||||
procedure RTLeventsync(m:trtlmethod;p:tprocedure);
|
procedure RTLeventsync(m:trtlmethod;p:tprocedure);
|
||||||
procedure RTLchecksynchronize;
|
procedure RTLchecksynchronize;
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.23 2004-12-27 15:28:40 marco
|
Revision 1.24 2004-12-28 14:20:03 marco
|
||||||
|
* tthread patch from neli
|
||||||
|
|
||||||
|
Revision 1.23 2004/12/27 15:28:40 marco
|
||||||
* checksynchronize now in interface win32 uses the default impl.
|
* checksynchronize now in interface win32 uses the default impl.
|
||||||
unix uses systhrds, rest empty implementation.
|
unix uses systhrds, rest empty implementation.
|
||||||
|
|
||||||
|
@ -528,12 +528,19 @@ begin
|
|||||||
pthread_mutex_unlock(@p^.mutex);
|
pthread_mutex_unlock(@p^.mutex);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure intRTLEventWaitFor(AEvent: PRTLEvent);
|
procedure intRTLEventStartWait(AEvent: PRTLEvent);
|
||||||
var p:pintrtlevent;
|
var p:pintrtlevent;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
p:=pintrtlevent(aevent);
|
p:=pintrtlevent(aevent);
|
||||||
pthread_mutex_lock(@p^.mutex);
|
pthread_mutex_lock(@p^.mutex);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure intRTLEventWaitFor(AEvent: PRTLEvent);
|
||||||
|
var p:pintrtlevent;
|
||||||
|
|
||||||
|
begin
|
||||||
|
p:=pintrtlevent(aevent);
|
||||||
pthread_cond_wait(@p^.condvar, @p^.mutex);
|
pthread_cond_wait(@p^.condvar, @p^.mutex);
|
||||||
pthread_mutex_unlock(@p^.mutex);
|
pthread_mutex_unlock(@p^.mutex);
|
||||||
end;
|
end;
|
||||||
@ -573,6 +580,7 @@ begin
|
|||||||
EnterCriticalSection(SynchronizeCritSect);
|
EnterCriticalSection(SynchronizeCritSect);
|
||||||
SynchronizeMethod := tthreadmethod(thrdmethd);
|
SynchronizeMethod := tthreadmethod(thrdmethd);
|
||||||
SynchronizeException := nil;
|
SynchronizeException := nil;
|
||||||
|
RtlEventStartWait(ExecuteEvent);
|
||||||
SynchronizeMethodProc;
|
SynchronizeMethodProc;
|
||||||
// wait infinitely
|
// wait infinitely
|
||||||
RtlEventWaitFor(ExecuteEvent);
|
RtlEventWaitFor(ExecuteEvent);
|
||||||
@ -658,6 +666,7 @@ begin
|
|||||||
rtlEventCreate :=@intrtlEventCreate;
|
rtlEventCreate :=@intrtlEventCreate;
|
||||||
rtlEventDestroy :=@intrtlEventDestroy;
|
rtlEventDestroy :=@intrtlEventDestroy;
|
||||||
rtlEventSetEvent :=@intrtlEventSetEvent;
|
rtlEventSetEvent :=@intrtlEventSetEvent;
|
||||||
|
rtlEventStartWait :=@intrtlEventStartWait;
|
||||||
rtleventWaitFor :=@intrtleventWaitFor;
|
rtleventWaitFor :=@intrtleventWaitFor;
|
||||||
rtleventsync :=trtleventsynchandler(@intrtleventsync);
|
rtleventsync :=trtleventsynchandler(@intrtleventsync);
|
||||||
rtlchksyncunix :=@checksynchronize;
|
rtlchksyncunix :=@checksynchronize;
|
||||||
@ -673,7 +682,10 @@ finalization
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.18 2004-12-27 15:28:40 marco
|
Revision 1.19 2004-12-28 14:20:03 marco
|
||||||
|
* tthread patch from neli
|
||||||
|
|
||||||
|
Revision 1.18 2004/12/27 15:28:40 marco
|
||||||
* checksynchronize now in interface win32 uses the default impl.
|
* checksynchronize now in interface win32 uses the default impl.
|
||||||
unix uses systhrds, rest empty implementation.
|
unix uses systhrds, rest empty implementation.
|
||||||
|
|
||||||
|
@ -437,6 +437,11 @@ end;
|
|||||||
|
|
||||||
CONST INFINITE=-1;
|
CONST INFINITE=-1;
|
||||||
|
|
||||||
|
procedure intRTLEventStartWait(AEvent: PRTLEvent);
|
||||||
|
begin
|
||||||
|
// nothing to do, win32 events stay signalled after being set
|
||||||
|
end;
|
||||||
|
|
||||||
procedure intRTLEventWaitFor(AEvent: PRTLEvent);
|
procedure intRTLEventWaitFor(AEvent: PRTLEvent);
|
||||||
begin
|
begin
|
||||||
WaitForSingleObject(THANDLE(AEvent), INFINITE);
|
WaitForSingleObject(THANDLE(AEvent), INFINITE);
|
||||||
@ -479,10 +484,11 @@ begin
|
|||||||
BasicEventResetEvent :=@intBasicEventResetEvent;
|
BasicEventResetEvent :=@intBasicEventResetEvent;
|
||||||
BasicEventSetEvent :=@intBasicEventSetEvent;
|
BasicEventSetEvent :=@intBasicEventSetEvent;
|
||||||
BasiceventWaitFor :=@intBasiceventWaitFor;
|
BasiceventWaitFor :=@intBasiceventWaitFor;
|
||||||
RTLEventCreate :=@intRTLEventCreate;
|
RTLEventCreate :=@intRTLEventCreate;
|
||||||
RTLEventDestroy :=@intRTLEventDestroy;
|
RTLEventDestroy :=@intRTLEventDestroy;
|
||||||
RTLEventSetEvent :=@intRTLEventSetEvent;
|
RTLEventSetEvent :=@intRTLEventSetEvent;
|
||||||
RTLeventWaitFor :=@intRTLeventWaitFor;
|
RTLEventStartWait :=@intRTLEventStartWait;
|
||||||
|
RTLEventWaitFor :=@intRTLEventWaitFor;
|
||||||
end;
|
end;
|
||||||
SetThreadManager(WinThreadManager);
|
SetThreadManager(WinThreadManager);
|
||||||
InitHeapMutexes;
|
InitHeapMutexes;
|
||||||
@ -494,7 +500,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2004-12-26 13:46:45 peter
|
Revision 1.14 2004-12-28 14:20:03 marco
|
||||||
|
* tthread patch from neli
|
||||||
|
|
||||||
|
Revision 1.13 2004/12/26 13:46:45 peter
|
||||||
* tthread uses systhrds
|
* tthread uses systhrds
|
||||||
|
|
||||||
Revision 1.12 2004/12/22 21:29:24 marco
|
Revision 1.12 2004/12/22 21:29:24 marco
|
||||||
|
Loading…
Reference in New Issue
Block a user