* GSAtomic: Add prefix to macro definitions
* NSKVOSupport: Import
* NSKVOSupport: Add test cases
* NSKVOSwizzling: Ugly C Rewrite
* NSKeyValueObserving: Use old implementation as fallback
* NSKeyValueObserving: Rename TypeEncodingCases header
* NSKVOSupport: Fix new objects not being added to NSKeyValueChangeNew set on set mutation
* NSKeyValueMutableSet: Fix will and didChange notifications for set operations
* NSKeyValueMutableSet: Document Accessor Search Patterns
* NSKVOSupport: Add toMany test
* NSKeyValueCoding: Change notifications when changing value via setValue:forKey:
* NSKVOSupport: Add more tests
* NSKVOSupport: Do not wrap block in try/finally to avoid crash in windows
* NSKVOSwizzling: use _alloca on Windows
* NSKVOSupport: Do not autorelease newWithObservee:
* NSKVOSupport: Do not leak Observee and TestFacade objects
* Improve runtime detection in makefile
* Add file extension of source file in GNUMakefile
* NSKVOSupport: Remove @status comments
* NSKVOSupport: Implement private notify method
* NSUserDefaults: KVO Support and fix macOS incompatibilities
* NSKeyValueObserving: Set old to null if nil
* NSKeyValueObserving: Remove cached new value
* NSMethodSignature: Add signature cache
* NSKVOSupport: Remove ObjC2 features and mark tests failing on GCC as hopeful
* Call class method instead of private _keyPathsForValuesAffectingValueForKey
* Move _keyPathsForValuesAffectingValueForKey body into class method and statically construct empty NSSet
* NSUserDefaults: Change notification should contain old value from other domains aswell
* NSUserDefaults: Fetch new value from all domains
* NSKVOInternal: Fixup filename in header
* NSUserDefaults: Go through search list instead of only one domain in KVO change
* Making indentation a bit less worse
* Add NSUserDefaults KVO tests
* NSKVOSupport: NSUserDefaults test small fixes
* Add autoreleasepool
* NSUserDefaults: Only emit change notifications if value changed
* Avoid compiler warnings and tidy some of the whitespace/formatting
---------
Co-authored-by: Frederik Seiffert <frederik@algoriddim.com>
Co-authored-by: rfm <richardfrithmacdonald@gmail.com>
Co-authored-by: rfm <rfm@gnu.org>
Removes dependency on pthread library and uses fast Slim Reader/Writer (SRW) locks for NSLock/NSRecursiveLock/NSCondition/NSConditionLock as well as all internal locks. Adds GS_MUTEX_*() macros in GSPThread.h, that are being used for all internal locking instead of pthread APIs.
Also adds support for thread priorities on Windows, fixes method signature of +[NSThread setThreadPriority:] to match Apple platforms, and adds error handling in same method.
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
* 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