This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

FW: sched* functions, pthread rework


Ok here's round one of a full overhaul of the pthreads code.
This appears fully stable to me. Rather than emulating some of the win32
features (such as using an array to store the thread list) this simply
utilises win32 for most of the functionality needed. I've replaced a lot
of the Macro'd one liners (about 6 lines er macro) with two line tests,
which has aided my debugging unbelievably.

For clarity: the sched* functions are not thread related and should be
in cygwin1.dll even when it's built non threaded..
 
New files: sched.cc, include/semaphore.h, include/sched.h
 
There are still 6 FIXME's in the code: 3 are notes for adding optional
features, 2 are from before my time and I'll look into them shortly. 1
is because I haven't implemented the pthread_key_* destructor logic yet.
I'll be doing that shortly... but now was a good point to the core of
the work into CVS (it's nice and stable :] ).

Next on the hit list are the pthread_cleanup* functions and  the
pthread_ fork related functions.
 
Changelog:
21 Mar 2001 Robert Collins <rbtcollins@hotmail.com>
   * include/semaphore: New file. Semaphore prototypes that were
incorrectly in pthread.h.
   * Makefile.in: Add sched.o to the object list for cygwin1.dll.
   * cygwin.din: Add exports for sched*.
   * pinfo.h: Change references to class ThreadItem to class pthread.
   * include/pthread.h: Typedef pthread_*_t as void * not int. Add some
posix defines.
   * pthread.cc: Fixed indentation. Add pthread_attrset/get detachstate.
   * thread.cc: Rewrite core logic.
   (MTitem): Remove.
   (ThreadItem): Remove.
   (SemItem): Remove.
   (MutexItem): Remove.
   (CondItem): Remove.
   (pthread): New class.
   (pthread_attr): New class.
   (pthread_mutex): New class.
   (pthread_mutexattr): New class.
   (pthread_key): New class.
   (pthread_cond): New class.
   (pthread_condattr): New class.
   (semaphore): New class.
   Add __pthread_attr_setdetachstate() and
__pthread_attr_getdetachstate().
   Fix pthread_exit and return logic.
   * thread.h:
   (MTitem): Remove.
   (ThreadItem): Remove.
   (SemItem): Remove.
   (MutexItem): Remove.
   (CondItem): Remove.
   (pthread): New class.
   (pthread_attr): New class.
   (pthread_mutex): New class.
   (pthread_mutexattr): New class.
   (pthread_key): New class.
   (pthread_cond): New class.
   (pthread_condattr): New class.
   (semaphore): New class.
   Add __pthread_attr_setdetachstate() and
__pthread_attr_getdetachstate().

Rob

semaphore.h

pthread_rework.patch


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]