]> Zhao Yanbai Git Server - minix.git/commit
Experimental pthread compatibility library
authorLionel Sambuc <lionel@minix3.org>
Tue, 14 Jan 2014 12:48:43 +0000 (13:48 +0100)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:05:08 +0000 (17:05 +0200)
commitd3d33afe9f58deb8d30c3b4e29c969b33f9c3c34
treec97b27da784693b6496c44568f99f6947f7cc0ed
parent29b8e5ff06775f48546ddc9f3b03875fac0231fd
Experimental pthread compatibility library

This patch adds pthread compatibility by using libmthread.

To use this with a program using pthreads, you have to replace
  #include <pthread>
with
  #define _MTHREADIFY_PTHREADS
  #include <minix/mthreads>

This also changes the initialization function to be a constructor, which
is implicitly called before the call to main. This allows for
conformance with pthreads, while not paying a high price by checking on
each mthread_* call whether the library has been initialized or not.

As mthread_init is now a constructor, it also has been set as static, and
relevent calls removed from programs using it.

Change-Id: I2aa375db557958d2bee9a70d285aabb990c88f00
21 files changed:
distrib/sets/lists/minix/mi
include/minix/mthread.h
lib/Makefile
lib/libblockdriver/driver_mt.c
lib/libmthread/Makefile
lib/libmthread/allocate.c
lib/libmthread/attribute.c
lib/libmthread/condition.c
lib/libmthread/event.c
lib/libmthread/key.c
lib/libmthread/mutex.c
lib/libmthread/proto.h
lib/libmthread/pthread_compat.c [new file with mode: 0644]
lib/libmthread/rwlock.c
lib/libmthread/scheduler.c
lib/libmthread/shlib_version [new file with mode: 0644]
servers/vfs/threads.h
servers/vfs/worker.c
share/mk/bsd.lib.mk
share/mk/bsd.prog.mk
test/test59.c