mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
Use @defs to access NSThread ivars from functions otherwise gcc 3.1 won't
compile it git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11831 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
803a956a7a
commit
0927a53e7d
1 changed files with 6 additions and 3 deletions
|
@ -424,6 +424,9 @@ gnustep_base_thread_callback()
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
typedef struct { @defs(NSThread) } NSThread_ivars;
|
||||||
|
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
GSRegisterCurrentThread (void)
|
GSRegisterCurrentThread (void)
|
||||||
{
|
{
|
||||||
|
@ -449,7 +452,7 @@ GSRegisterCurrentThread (void)
|
||||||
NSDefaultMallocZone ());
|
NSDefaultMallocZone ());
|
||||||
thread = [thread _initWithSelector: NULL toTarget: nil withObject: nil];
|
thread = [thread _initWithSelector: NULL toTarget: nil withObject: nil];
|
||||||
objc_thread_set_data (thread);
|
objc_thread_set_data (thread);
|
||||||
((NSThread *)thread)->_active = YES;
|
((NSThread_ivars *)thread)->_active = YES;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We post the notification after we register the thread.
|
* We post the notification after we register the thread.
|
||||||
|
@ -474,14 +477,14 @@ GSUnregisterCurrentThread (void)
|
||||||
|
|
||||||
thread = GSCurrentThread();
|
thread = GSCurrentThread();
|
||||||
|
|
||||||
if (thread->_active == YES)
|
if (((NSThread_ivars *)thread)->_active == YES)
|
||||||
{
|
{
|
||||||
NSNotification *n;
|
NSNotification *n;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the thread to be inactive to avoid any possibility of recursion.
|
* Set the thread to be inactive to avoid any possibility of recursion.
|
||||||
*/
|
*/
|
||||||
thread->_active = NO;
|
((NSThread_ivars *)thread)->_active = NO;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Let observers know this thread is exiting.
|
* Let observers know this thread is exiting.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue