threadh.inc 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Run time library.
  4. Copyright (c) 2000 by the Free Pascal development team
  5. This File contains the OS indenpendend declartions for multi
  6. threading support in FPC
  7. See the File COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **********************************************************************}
  13. {$ifdef MT}
  14. type
  15. TThreadFunc = function(parameter : pointer) : longint;
  16. {*****************************************************************************
  17. Multithread Handling
  18. *****************************************************************************}
  19. function BeginThread(sa : Pointer;stacksize : dword;
  20. ThreadFunction : tthreadfunc;p : pointer;creationFlags : dword;
  21. var ThreadId : DWord) : DWord;
  22. { add some simplfied forms which make lifer easier and porting }
  23. { to other OSes too ... }
  24. function BeginThread(ThreadFunction : tthreadfunc) : DWord;
  25. function BeginThread(ThreadFunction : tthreadfunc;p : pointer) : DWord;
  26. function BeginThread(ThreadFunction : tthreadfunc;p : pointer;
  27. var ThreadId : DWord) : DWord;
  28. procedure EndThread(ExitCode : DWord);
  29. procedure EndThread;
  30. { this allows to do a lot of things in MT safe way }
  31. { it is also used to make the heap management }
  32. { thread safe }
  33. procedure InitCriticalSection(var cs : TRTLCriticalSection);
  34. procedure DoneCriticalsection(var cs : TRTLCriticalSection);
  35. procedure EnterCriticalsection(var cs : TRTLCriticalSection);
  36. procedure LeaveCriticalsection(var cs : TRTLCriticalSection);
  37. {$endif MT}
  38. {
  39. $Log$
  40. Revision 1.5 2001-10-23 21:51:03 peter
  41. * criticalsection renamed to rtlcriticalsection for kylix compatibility
  42. Revision 1.4 2001/01/26 16:37:54 florian
  43. *** empty log message ***
  44. Revision 1.3 2001/01/24 21:47:18 florian
  45. + more MT stuff added
  46. Revision 1.2 2001/01/05 17:35:50 florian
  47. * the info about exception frames is stored now on the stack
  48. instead on the heap
  49. Revision 1.1 2001/01/01 19:06:59 florian
  50. + initial release
  51. }