ObjFW  Diff

Differences From Artifact [907c5a1a16]:

To Artifact [e6c064086f]:


70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
}

+ threadWithObject: (id)obj
{
	return [[[self alloc] initWithObject: obj] autorelease];
}

+ (id)setObject: (id)obj
      forTLSKey: (OFTLSKey*)key
{
	id old = of_tlskey_get(key->key);

	if (!of_tlskey_set(key->key, [obj retain]))
		@throw [OFInvalidArgumentException newWithClass: self
						       selector: _cmd];

	return [old autorelease];
}

+ (id)objectForTLSKey: (OFTLSKey*)key
{
	return of_tlskey_get(key->key);
}

+ (OFThread*)currentThread
{
	return of_tlskey_get(thread_self);
}

+ (void)sleepForTimeInterval: (int64_t)sec
{
	if (sec < 0)
		@throw [OFOutOfRangeException newWithClass: self];








|
|







|




|




|







70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
}

+ threadWithObject: (id)obj
{
	return [[[self alloc] initWithObject: obj] autorelease];
}

+ (void)setObject: (id)obj
	forTLSKey: (OFTLSKey*)key
{
	id old = of_tlskey_get(key->key);

	if (!of_tlskey_set(key->key, [obj retain]))
		@throw [OFInvalidArgumentException newWithClass: self
						       selector: _cmd];

	[old release];
}

+ (id)objectForTLSKey: (OFTLSKey*)key
{
	return [[of_tlskey_get(key->key) retain] autorelease];
}

+ (OFThread*)currentThread
{
	return [[of_tlskey_get(thread_self) retain] autorelease];
}

+ (void)sleepForTimeInterval: (int64_t)sec
{
	if (sec < 0)
		@throw [OFOutOfRangeException newWithClass: self];