systhrds.pp 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2002 by Peter Vreman,
  5. member of the Free Pascal development team.
  6. Linux (pthreads) threading support implementation
  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. {$mode objfpc}
  14. {$define dynpthreads}
  15. unit systhrds;
  16. interface
  17. uses
  18. unixtype;
  19. { Posix compliant definition }
  20. type
  21. PRTLCriticalSection = ^TRTLCriticalSection;
  22. TRTLCriticalSection = pthread_mutex_t;
  23. { Include generic thread interface }
  24. {$i threadh.inc}
  25. implementation
  26. {*****************************************************************************
  27. Generic overloaded
  28. *****************************************************************************}
  29. { Include generic overloaded routines }
  30. {$i thread.inc}
  31. { Include OS independent Threadvar initialization }
  32. {$ifdef HASTHREADVAR}
  33. {$i threadvr.inc}
  34. {$endif HASTHREADVAR}
  35. Procedure InitSystemThreads;
  36. begin
  37. SetNoThreadManager;
  38. end;
  39. initialization
  40. InitSystemThreads;
  41. end.
  42. {
  43. $Log$
  44. Revision 1.22 2004-09-09 20:29:06 jonas
  45. * fixed definition of pthread_mutex_t for non-linux targets (and for
  46. linux as well, actually).
  47. * base libpthread definitions are now in ptypes.inc, included in unixtype
  48. They sometimes have an extra underscore in front of their name, in
  49. case they were also exported by the packages/base/pthreads unit, so
  50. they can keep their original name there
  51. * cthreadds unit now imports systuils, because it uses exceptions (it
  52. already did so before as well)
  53. * fixed many linux definitions of libpthread functions in pthrlinux.inc
  54. (integer -> cint etc)
  55. + added culonglong type to ctype.inc
  56. Revision 1.21 2003/11/26 20:10:59 michael
  57. + New threadmanager implementation
  58. Revision 1.20 2003/11/19 10:54:32 marco
  59. * some simple restructures
  60. Revision 1.19 2003/11/18 22:36:12 marco
  61. * Last patch was ok, problem was somewhere else. Moved *BSD part of pthreads to freebsd/pthreads.inc
  62. Revision 1.18 2003/11/18 22:35:09 marco
  63. * Last patch was ok, problem was somewhere else. Moved *BSD part of pthreads to freebsd/pthreads.inc
  64. Revision 1.17 2003/11/17 10:05:51 marco
  65. * threads for FreeBSD. Not working tho
  66. Revision 1.16 2003/11/17 08:27:50 marco
  67. * pthreads based ttread from Johannes Berg
  68. Revision 1.15 2003/10/01 21:00:09 peter
  69. * GetCurrentThreadHandle renamed to GetCurrentThreadId
  70. Revision 1.14 2003/10/01 20:53:08 peter
  71. * GetCurrentThreadId implemented
  72. Revision 1.13 2003/09/20 12:38:29 marco
  73. * FCL now compiles for FreeBSD with new 1.1. Now Linux.
  74. Revision 1.12 2003/09/16 13:17:03 marco
  75. * Wat cleanup, ouwe syscalls nu via baseunix e.d.
  76. Revision 1.11 2003/09/16 13:00:02 marco
  77. * small BSD gotcha removed (typing mmap params)
  78. Revision 1.10 2003/09/15 20:08:49 marco
  79. * small fixes. FreeBSD now cycles
  80. Revision 1.9 2003/09/14 20:15:01 marco
  81. * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
  82. Revision 1.8 2003/03/27 17:14:27 armin
  83. * more platform independent thread routines, needs to be implemented for unix
  84. Revision 1.7 2003/01/05 19:11:32 marco
  85. * small changes originating from introduction of Baseunix to FreeBSD
  86. Revision 1.6 2002/11/11 21:41:06 marco
  87. * syscall.inc -> syscallo.inc
  88. Revision 1.5 2002/10/31 13:45:21 carl
  89. * threadvar.inc -> threadvr.inc
  90. Revision 1.4 2002/10/26 18:27:52 marco
  91. * First series POSIX calls commits. Including getcwd.
  92. Revision 1.3 2002/10/18 18:05:06 marco
  93. * $I pthread.inc instead of pthreads.inc
  94. Revision 1.2 2002/10/18 12:19:59 marco
  95. * Fixes to get the generic *BSD RTL compiling again + fixes for thread
  96. support. Still problems left in fexpand. (inoutres?) Therefore fixed
  97. sysposix not yet commited
  98. Revision 1.1 2002/10/16 06:22:56 michael
  99. Threads renamed from threads to systhrds
  100. Revision 1.1 2002/10/14 19:39:17 peter
  101. * threads unit added for thread support
  102. }