Commit graph

61 commits

Author SHA1 Message Date
Richard Frith-MacDonald
b969c50ba7 add defines for clang and non-fragile ivars
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/reorg@29561 72102866-910b-0410-8b05-ffd578937521
2010-02-11 19:57:31 +00:00
Richard Frith-MacDonald
3fa37b0f6b minor osx compatibility improvement ... log message for deadlock
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/reorg@29539 72102866-910b-0410-8b05-ffd578937521
2010-02-11 09:02:53 +00:00
Richard Frith-MacDonald
21e9e1231f Corrected last commit
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29475 72102866-910b-0410-8b05-ffd578937521
2010-02-04 08:15:09 +00:00
Richard Frith-MacDonald
7f2d7d10eb Fixup bad indentation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29473 72102866-910b-0410-8b05-ffd578937521
2010-02-03 22:13:48 +00:00
Jonathan Gillaspie
d85c001251 Fix several problems with lockWhenCondition:beforeDate:
First -- it needs to use timeIntervalSince1970 to be using the same reference date required for pthread_cond_timedwait
Second -- lockWhenCondition needs to loop because pthread_cond_timedwait can return prior to delay expiring (but with the wrong condition).
Third -- Internally the lock was incorrectly being unlocked on a delayed acquire (and YES return).  And was incorrectly being unlocked a second time when the timeout expired.

Also, fixed a problem with tryLockWhenCondition:
By calling lockWhenCondition: it would incorrectly report a deadlock (rather than just return no) when we already have the lock.

All these changes are in line with expected and documented behavior for NSLock.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29472 72102866-910b-0410-8b05-ffd578937521
2010-02-03 21:15:03 +00:00
Richard Frith-MacDonald
19796a1465 Documentation generation improvments
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29047 72102866-910b-0410-8b05-ffd578937521
2009-11-23 09:42:18 +00:00
Richard Frith-MacDonald
c0f76095d1 BOOL must be YES or NO
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28754 72102866-910b-0410-8b05-ffd578937521
2009-09-30 20:12:14 +00:00
David Chisnall
1874665069 Fixed bug in -lockWhenCondition:beforeDate: (was not releasing mutex correctly).
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28752 72102866-910b-0410-8b05-ffd578937521
2009-09-30 12:40:00 +00:00
Richard Frith-MacDonald
6b1b12123a Small bugfixes and OSX compatibility tweak.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28616 72102866-910b-0410-8b05-ffd578937521
2009-09-06 14:37:07 +00:00
Richard Frith-MacDonald
d626a852e5 Fix wrong version commit
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28613 72102866-910b-0410-8b05-ffd578937521
2009-09-06 11:02:57 +00:00
Richard Frith-MacDonald
418330b29d Avoid exposing pthread details in NSLock.h (as much as possible without
impacting performance).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28612 72102866-910b-0410-8b05-ffd578937521
2009-09-06 10:56:04 +00:00
Richard Frith-MacDonald
b4ddaee78f Minor fixes/tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28605 72102866-910b-0410-8b05-ffd578937521
2009-09-03 09:45:23 +00:00
David Chisnall
0e49e6e9fb Removed bonus semicolon added in earlier commit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28603 72102866-910b-0410-8b05-ffd578937521
2009-09-02 22:15:05 +00:00
David Chisnall
28618978db Fixed bug noticed by Fred.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28602 72102866-910b-0410-8b05-ffd578937521
2009-09-02 22:13:48 +00:00
David Chisnall
39c9ec5afd Fixed typo pointed out by Philippe Roussel.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28600 72102866-910b-0410-8b05-ffd578937521
2009-09-02 16:07:00 +00:00
David Chisnall
a9639aa3fa Added fix for error reported by Philippe Roussel on GNU/Linux.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28599 72102866-910b-0410-8b05-ffd578937521
2009-09-02 14:47:16 +00:00
David Chisnall
d7a877b871 * Source/NSLock.m
* 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
2009-09-02 13:03:13 +00:00
Gregory John Casamento
d2015542c0 Move NSLog to NSDebugLog for the WARNING.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28203 72102866-910b-0410-8b05-ffd578937521
2009-04-11 05:13:33 +00:00
Richard Frith-MacDonald
24d43481a8 Updates for 10.5 API changes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27962 72102866-910b-0410-8b05-ffd578937521
2009-02-23 20:42:32 +00:00
Richard Frith-MacDonald
4006fb9f00 Fix to return correct value when -tryLock is attempted recursively.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27730 72102866-910b-0410-8b05-ffd578937521
2009-01-30 10:22:50 +00:00
Gregory John Casamento
f77a3d4091 * Source/NSLock.m: Change to correct documented/tested and observed
inconsistency between Cocoa (and OpenStep) and GNUstep.  
	Reinstatement of correction for bug #25307.   Testing on both OpenStep
	and on Cocoa clearly illustrates that throwing an exception in this
	case was incorrect.  It now emits a warning when the lock is attempted
	again, but does not throw an exception.
	* Testing/locktest/locktest.m: Change to test to correctly test
	[NSConditionLock lock]


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27726 72102866-910b-0410-8b05-ffd578937521
2009-01-29 23:01:51 +00:00
Richard Frith-MacDonald
61a6648a75 Revrt (temporarily?) inconsistent change in locking behavior.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27618 72102866-910b-0410-8b05-ffd578937521
2009-01-17 08:30:11 +00:00
Gregory John Casamento
1481ce2b54 * Source/NSLock.m: Correction for bug #25307. According to Cocoa
documentation, NSConditionLock should return NO, if the lock is
	unavailable.  No exception should be thrown.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27612 72102866-910b-0410-8b05-ffd578937521
2009-01-16 22:20:42 +00:00
Richard Frith-MacDonald
b830b55dee Change finalization to match MacOS-X
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27581 72102866-910b-0410-8b05-ffd578937521
2009-01-12 18:36:37 +00:00
Richard Frith-MacDonald
dce58731aa clear ivars when deallocating
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27303 72102866-910b-0410-8b05-ffd578937521
2008-12-16 09:12:18 +00:00
Richard Frith-MacDonald
b2b14398d2 allow developers more time to adapt to LGPLv3
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26606 72102866-910b-0410-8b05-ffd578937521
2008-06-08 10:38:33 +00:00
Richard Frith-MacDonald
ec0b3ab41a MacOS-X compatibility updates.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26598 72102866-910b-0410-8b05-ffd578937521
2008-06-06 13:57:06 +00:00
Richard Frith-MacDonald
62559023b9 Update to GPL3 and LGPL3
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25482 72102866-910b-0410-8b05-ffd578937521
2007-09-14 11:36:11 +00:00
Richard Frith-MacDonald
0ebe68ae48 More code tidyups and NSError updates.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23921 72102866-910b-0410-8b05-ffd578937521
2006-10-20 10:56:27 +00:00
Richard Frith-Macdonald
c9c6734169 Spelling fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21962 72102866-910b-0410-8b05-ffd578937521
2005-11-06 13:53:40 +00:00
Adam Fedor
fcc13ccd0f * Update FSF Address.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21245 72102866-910b-0410-8b05-ffd578937521
2005-05-22 03:32:16 +00:00
Richard Frith-Macdonald
db7b22a4fb Tidy up use of white space so we have it after if/for/while and not after (
or before ) or padding at end of line.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20773 72102866-910b-0410-8b05-ffd578937521
2005-02-22 11:22:44 +00:00
Adrian Robert
bda35fceb3 added GSdoc comments to class, method, and function declarations; for some classes some comments were already in the source file (not the header), in which case further comments were added here; otherwise comments were put in the headers
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19588 72102866-910b-0410-8b05-ffd578937521
2004-06-22 22:40:40 +00:00
David Ayers
1767ef985f * Headers/Foundation/NSLock.h: Make types of _mutex and
_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
2004-02-17 12:55:02 +00:00
David Ayers
c2b8811456 * Headers/Additions/GNUstepBase/GSLock.h: Added missing
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
2003-10-30 13:44:55 +00:00
David Ayers
ac30183cd6 Header reorganizsateion - Please refer to ChangeLog
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17407 72102866-910b-0410-8b05-ffd578937521
2003-07-31 23:49:32 +00:00
Richard Frith-Macdonald
48f9df8091 lockBeforeDate improvements.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17263 72102866-910b-0410-8b05-ffd578937521
2003-07-20 06:37:25 +00:00
Adam Fedor
d228cba99b Change syntax of includes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16874 72102866-910b-0410-8b05-ffd578937521
2003-06-07 01:24:41 +00:00
Richard Frith-Macdonald
781772708f Minor mingw fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15539 72102866-910b-0410-8b05-ffd578937521
2003-01-07 18:33:51 +00:00
Richard Frith-Macdonald
14fb009311 Clear mutex after release.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14551 72102866-910b-0410-8b05-ffd578937521
2002-09-25 04:55:40 +00:00
Richard Frith-Macdonald
fddaa462bc Documentation tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14298 72102866-910b-0410-8b05-ffd578937521
2002-08-20 10:22:05 +00:00
Richard Frith-Macdonald
19cf3829e4 Fixes to get stuff to work after autoconf changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13578 72102866-910b-0410-8b05-ffd578937521
2002-05-02 21:22:06 +00:00
Richard Frith-Macdonald
0fd81a9591 Fix blocking in run loop.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@12567 72102866-910b-0410-8b05-ffd578937521
2002-02-20 06:42:05 +00:00
Richard Frith-Macdonald
a0a6f5f346 Added date version and title
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11814 72102866-910b-0410-8b05-ffd578937521
2001-12-18 16:54:15 +00:00
Richard Frith-Macdonald
5be36e089c Many minor fixes for autogsdoc.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11787 72102866-910b-0410-8b05-ffd578937521
2001-12-17 14:31:42 +00:00
Adam Fedor
ab320f7bb0 Merged 1.0 branch into main.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9548 72102866-910b-0410-8b05-ffd578937521
2001-04-10 03:27:01 +00:00
Nicola Pero
6d7536d1c2 Commented out token after #endif as the 3.x gcc compilers complain about it
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9241 72102866-910b-0410-8b05-ffd578937521
2001-02-27 15:54:17 +00:00
Richard Frith-MacDonald
6bd908543d tidied
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7512 72102866-910b-0410-8b05-ffd578937521
2000-09-14 09:37:13 +00:00
Richard Frith-MacDonald
8f751cf9f8 GC tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7509 72102866-910b-0410-8b05-ffd578937521
2000-09-14 08:48:05 +00:00
Richard Frith-MacDonald
d1334aab5b Masses of fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@5474 72102866-910b-0410-8b05-ffd578937521
1999-12-13 12:14:01 +00:00