systhrds.pp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. { Posix compliant definition }
  18. type
  19. PRTLCriticalSection = ^TRTLCriticalSection;
  20. TRTLCriticalSection = record
  21. m_spinlock : longint;
  22. m_count : longint;
  23. m_owner : pointer {pthread_t};
  24. m_kind : longint;
  25. m_waiting : record
  26. head,tail : pointer;
  27. end; {_pthread_queue}
  28. end;
  29. { Include generic thread interface }
  30. {$i threadh.inc}
  31. implementation
  32. {*****************************************************************************
  33. Generic overloaded
  34. *****************************************************************************}
  35. { Include generic overloaded routines }
  36. {$i thread.inc}
  37. { Include OS independent Threadvar initialization }
  38. {$ifdef HASTHREADVAR}
  39. {$i threadvr.inc}
  40. {$endif HASTHREADVAR}
  41. Procedure InitSystemThreads;
  42. begin
  43. SetNoThreadManager;
  44. end;
  45. initialization
  46. InitSystemThreads;
  47. end.
  48. {
  49. $Log$
  50. Revision 1.21 2003-11-26 20:10:59 michael
  51. + New threadmanager implementation
  52. Revision 1.20 2003/11/19 10:54:32 marco
  53. * some simple restructures
  54. Revision 1.19 2003/11/18 22:36:12 marco
  55. * Last patch was ok, problem was somewhere else. Moved *BSD part of pthreads to freebsd/pthreads.inc
  56. Revision 1.18 2003/11/18 22:35:09 marco
  57. * Last patch was ok, problem was somewhere else. Moved *BSD part of pthreads to freebsd/pthreads.inc
  58. Revision 1.17 2003/11/17 10:05:51 marco
  59. * threads for FreeBSD. Not working tho
  60. Revision 1.16 2003/11/17 08:27:50 marco
  61. * pthreads based ttread from Johannes Berg
  62. Revision 1.15 2003/10/01 21:00:09 peter
  63. * GetCurrentThreadHandle renamed to GetCurrentThreadId
  64. Revision 1.14 2003/10/01 20:53:08 peter
  65. * GetCurrentThreadId implemented
  66. Revision 1.13 2003/09/20 12:38:29 marco
  67. * FCL now compiles for FreeBSD with new 1.1. Now Linux.
  68. Revision 1.12 2003/09/16 13:17:03 marco
  69. * Wat cleanup, ouwe syscalls nu via baseunix e.d.
  70. Revision 1.11 2003/09/16 13:00:02 marco
  71. * small BSD gotcha removed (typing mmap params)
  72. Revision 1.10 2003/09/15 20:08:49 marco
  73. * small fixes. FreeBSD now cycles
  74. Revision 1.9 2003/09/14 20:15:01 marco
  75. * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
  76. Revision 1.8 2003/03/27 17:14:27 armin
  77. * more platform independent thread routines, needs to be implemented for unix
  78. Revision 1.7 2003/01/05 19:11:32 marco
  79. * small changes originating from introduction of Baseunix to FreeBSD
  80. Revision 1.6 2002/11/11 21:41:06 marco
  81. * syscall.inc -> syscallo.inc
  82. Revision 1.5 2002/10/31 13:45:21 carl
  83. * threadvar.inc -> threadvr.inc
  84. Revision 1.4 2002/10/26 18:27:52 marco
  85. * First series POSIX calls commits. Including getcwd.
  86. Revision 1.3 2002/10/18 18:05:06 marco
  87. * $I pthread.inc instead of pthreads.inc
  88. Revision 1.2 2002/10/18 12:19:59 marco
  89. * Fixes to get the generic *BSD RTL compiling again + fixes for thread
  90. support. Still problems left in fexpand. (inoutres?) Therefore fixed
  91. sysposix not yet commited
  92. Revision 1.1 2002/10/16 06:22:56 michael
  93. Threads renamed from threads to systhrds
  94. Revision 1.1 2002/10/14 19:39:17 peter
  95. * threads unit added for thread support
  96. }