* Headers/Foundation/NSLock.h
Completely rewritten implementations of NSLock.h classes. These are now
faster, more complete, OS X-compatible, and most importantly actually
work. The old ones, for example, called functions that were not
implemented on Windows.
* Source/NSThread.m
Call pthread functions directly in NSThread instead of via the libobjc
abstraction layer. Also fixed a few issues, such as GC not being
initialized properly for NSThread subclasses that override -main (Javaism
supported by OS X) and tidies up the code in several places, removing
premature optimizations, especially those that introduce a test for an
unlikely case at the start of a method and thus slow everything down.
As a result of this change, GNUstep now depends on an implementation of
POSIX threads. This is included as standard on all modern UNIX systems,
and as an option on less-modern UNIX systems and non-UNIX systems,
including Windows. If you are building GNUstep on Windows, please install
the pthreads-win32 package, available from:
http://sourceware.org/pthreads-win32/
PLEASE TEST THIS! There may be some code that depended on the old
behaviour. I have been running the new NSLock implementation on FreeBSD
for a few weeks without issue; please report to me any problems that you
have on your platform.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28598 72102866-910b-0410-8b05-ffd578937521
_condition opaic to avoid including private thr-mach.h header.
* Headers/Foundation/NSThread.h: Do not include private
thr-mach.h header.
* Source/thr-mach.h: Moved here from
Headers/Additions/GNUstepBase/thr-mach.h.
* Source/NSLock.m: Include private thr-mach.h header for
apple-gnu-gnu. Added defines for typing opaic instance
variables and use them in various methods.
* Source/NSThread.m: Include private thr-mach.h header for
apple-gnu-gnu.
* Source/thr-mach.m: Include private thr-mach.h header from
new location.
* Source/thr-pthread.m: Ditto.
* Source/GNUmakefile: Do not install private thr-mach.h
header.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18607 72102866-910b-0410-8b05-ffd578937521
forward declaration.
* Headers/Additions/GNUstepBase/GSCategories.h: Remove
declaraion of gnustep_global_lock.
(GS_INITIALIZED_LOCK): New macro.
(+[NSLock newLockAt:]): New method.
(+[NSRecursiveLock newLockAt:]): Ditto.
* Headers/Foundation/NSLock.h: Ditto.
* Source/Additions/GSCategories.m: Replace global lock with
local lock.
(_GSLockInitializer): New class to initialize local lock
safely.
(newLockAt): New static function shared by +newLockAt:
implementations to safely intialize lock variables.
(+[NSLock newLockAt:]): Implemented and documented.
(+[NSRecursiveLock newLockAt:]): Ditto.
* Source/Additions/GSCompatibility.m: Remove
gnustep_global_lock.
* Source/Additions/GSObjCRuntime.m: Remove superfluous
locking.
* Source/Additions/Unicode.m: Use new GS_INITIALIZED_LOCK
macro and replace global lock with local lock.
* Source/NSLock.m
(-[NSConditionLock lockWhenCondition:beforeDate:]):
Implemented.
* Testing/gslock.m: New test case.
* Testing/GNUmakefile: Add new test case.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18010 72102866-910b-0410-8b05-ffd578937521