ObjFW  Diff

Differences From Artifact [5bd8a09d91]:

To Artifact [cbd29f4328]:


49
50
51
52
53
54
55
56

57
58
59
60
61
62
63
49
50
51
52
53
54
55

56
57
58
59
60
61
62
63







-
+







#import "OFThread.h"
#import "OFThread+Private.h"
#import "OFAutoreleasePool+Private.h"
#import "OFAutoreleasePool.h"
#import "OFDate.h"
#import "OFDictionary.h"
#import "OFList.h"
#import "OFLocalization.h"
#import "OFLocale.h"
#import "OFRunLoop.h"
#import "OFString.h"

#ifdef OF_WINDOWS
# include <windows.h>
#endif

102
103
104
105
106
107
108
109

110
111
112
113
114
115
116
102
103
104
105
106
107
108

109
110
111
112
113
114
115
116







-
+







		    exceptionWithClass: [thread class]];

	thread->_pool = objc_autoreleasePoolPush();

	name = [thread name];
	if (name != nil)
		of_thread_set_name(
		    [name cStringWithEncoding: [OFLocalization encoding]]);
		    [name cStringWithEncoding: [OFLocale encoding]]);
	else
		of_thread_set_name(object_getClassName(thread));

	/*
	 * Nasty workaround for thread implementations which can't return a
	 * pointer on join.
	 */
283
284
285
286
287
288
289
290

291
292
293
294
295
296
297
283
284
285
286
287
288
289

290
291
292
293
294
295
296
297







-
+








+ (void)setName: (OFString *)name
{
	[[OFThread currentThread] setName: name];

	if (name != nil)
		of_thread_set_name(
		    [name cStringWithEncoding: [OFLocalization encoding]]);
		    [name cStringWithEncoding: [OFLocale encoding]]);
	else
		of_thread_set_name(class_getName([self class]));
}

+ (OFString *)name
{
	return [[OFThread currentThread] name];