gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSThread OS X 10.5 compatibility


From: David Wetzel
Subject: Re: NSThread OS X 10.5 compatibility
Date: Sat, 24 Nov 2007 18:47:51 +0100

hi,

that is my frist -- not jet tested -- code. just to avoid double work...

Index: Source/NSThread.m
===============================================================
====
--- Source/NSThread.m   (revision 25604)
+++ Source/NSThread.m   (working copy)
@@ -797,6 +797,34 @@
   return _thread_dictionary;
 }
 
+- (id)initWithTarget:(id)target selector:(SEL)selector object:(id)argument
+{
+  gnustep_base_thread_callback();
+
+  return [self _initWithSelector:selector
+                        toTarget:target
+                      withObject:argument];
+
+}
+
+- (void)start 
+{
+  
+  if (_active == YES) {
+    [NSException raise: NSInternalInconsistencyException
+                format: @"%s: Thread is already active.", __PRETTY_FUNCTION__];
+  }
+  /*
+   * Have the runtime detach the thread
+   */
+  if (objc_thread_detach(@selector(_sendThreadMethod), self, nil) == NULL)
+  {
+    [NSException raise: NSInternalInconsistencyException
+                format: @"Unable to detach thread (unknown error)"];
+  }
+  
+}
+
 @end
 
 

Index: Headers/Foundation/NSThread.h
===============================================================
====
--- Headers/Foundation/NSThread.h       (revision 25604)
+++ Headers/Foundation/NSThread.h       (working copy)
@@ -60,6 +60,8 @@
 + (double) threadPriority;
 
 - (NSMutableDictionary*) threadDictionary;
+- (id)initWithTarget:(id)target selector:(SEL)selector object:(id)argument;
+- (void)start;
 
 @end


Dave






reply via email to

[Prev in Thread] Current Thread [Next in Thread]