Skip to content

Commit 5915496

Browse files
authored
Revert "Add Thread::Local(T) (#15616)" (#16179)
This reverts commit 8fda88f. It's an internal type, we don't plan to use it anymore, and #16173 is meant to replace it. It's main feature was the ability to work on every target (unlike the current `@[ThreadLocal]` annotation) and to register destructors... but the annotation can be fixed using the EmulatedTLS LLVM option, and the destructor is crashing on x86_64-darwin when mixing pthreads, unwind and pcre2.
1 parent 47e0fb2 commit 5915496

File tree

32 files changed

+4
-205
lines changed

32 files changed

+4
-205
lines changed

src/crystal/system/thread_local.cr

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/crystal/system/unix/thread_local.cr

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/crystal/system/wasi/thread_local.cr

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/crystal/system/win32/thread_local.cr

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/lib_c/aarch64-android/c/pthread.cr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ lib LibC
2626
fun pthread_getspecific(__key : PthreadKeyT) : Void*
2727
fun pthread_join(__pthread : PthreadT, __return_value_ptr : Void**) : Int
2828
fun pthread_key_create(__key_ptr : PthreadKeyT*, __key_destructor : Void* ->) : Int
29-
fun pthread_key_delete(__key_ptr : PthreadKeyT) : Int
3029

3130
fun pthread_mutexattr_destroy(__attr : PthreadMutexattrT*) : Int
3231
fun pthread_mutexattr_init(__attr : PthreadMutexattrT*) : Int

src/lib_c/aarch64-darwin/c/pthread.cr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ lib LibC
1313
fun pthread_cond_wait(x0 : PthreadCondT*, x1 : PthreadMutexT*) : Int
1414
fun pthread_create(x0 : PthreadT*, x1 : PthreadAttrT*, x2 : Void* -> Void*, x3 : Void*) : Int
1515
fun pthread_detach(x0 : PthreadT) : Int
16-
fun pthread_getspecific(PthreadKeyT) : Void*
1716
fun pthread_get_stackaddr_np(x0 : PthreadT) : Void*
1817
fun pthread_get_stacksize_np(x0 : PthreadT) : SizeT
1918
fun pthread_join(x0 : PthreadT, x1 : Void**) : Int
20-
fun pthread_key_create(PthreadKeyT*, (Void*) ->) : Int
21-
fun pthread_key_delete(PthreadKeyT) : Int
2219
fun pthread_mutexattr_destroy(x0 : PthreadMutexattrT*) : Int
2320
fun pthread_mutexattr_init(x0 : PthreadMutexattrT*) : Int
2421
fun pthread_mutexattr_settype(x0 : PthreadMutexattrT*, x1 : Int) : Int
@@ -29,5 +26,4 @@ lib LibC
2926
fun pthread_mutex_unlock(x0 : PthreadMutexT*) : Int
3027
fun pthread_self : PthreadT
3128
fun pthread_setname_np(Char*) : Int
32-
fun pthread_setspecific(PthreadKeyT, Void*) : Int
3329
end

src/lib_c/aarch64-darwin/c/sys/types.cr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ lib LibC
4040
end
4141

4242
type PthreadT = Void*
43-
alias PthreadKeyT = UInt
4443
alias SSizeT = Long
4544
alias SusecondsT = Int
4645
alias TimeT = Long

src/lib_c/aarch64-linux-gnu/c/pthread.cr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@ lib LibC
2525
fun pthread_create(newthread : PthreadT*, attr : PthreadAttrT*, start_routine : Void* -> Void*, arg : Void*) : Int
2626
fun pthread_detach(th : PthreadT) : Int
2727
fun pthread_getattr_np(thread : PthreadT, attr : PthreadAttrT*) : Int
28-
fun pthread_getspecific(PthreadKeyT) : Void*
2928
fun pthread_equal(thread1 : PthreadT, thread2 : PthreadT) : Int
3029
fun pthread_join(th : PthreadT, thread_return : Void**) : Int
31-
fun pthread_key_create(PthreadKeyT*, (Void*) ->) : Int
32-
fun pthread_key_delete(PthreadKeyT) : Int
3330
fun pthread_mutexattr_destroy(attr : PthreadMutexattrT*) : Int
3431
fun pthread_mutexattr_init(attr : PthreadMutexattrT*) : Int
3532
fun pthread_mutexattr_settype(attr : PthreadMutexattrT*, type : Int) : Int
@@ -40,5 +37,4 @@ lib LibC
4037
fun pthread_mutex_unlock(mutex : PthreadMutexT*) : Int
4138
fun pthread_self : PthreadT
4239
fun pthread_setname_np(PthreadT, Char*) : Int
43-
fun pthread_setspecific(PthreadKeyT, Void*) : Int
4440
end

src/lib_c/aarch64-linux-gnu/c/sys/types.cr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ lib LibC
4141
end
4242

4343
alias PthreadT = ULong
44-
alias PthreadKeyT = UInt
4544
alias SSizeT = Long
4645
alias SusecondsT = Long
4746
alias TimeT = Long

src/lib_c/aarch64-linux-musl/c/pthread.cr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ lib LibC
1717
fun pthread_create(x0 : PthreadT*, x1 : PthreadAttrT*, x2 : Void* -> Void*, x3 : Void*) : Int
1818
fun pthread_detach(x0 : PthreadT) : Int
1919
fun pthread_getattr_np(x0 : PthreadT, x1 : PthreadAttrT*) : Int
20-
fun pthread_getspecific(PthreadKeyT) : Void*
2120
fun pthread_join(x0 : PthreadT, x1 : Void**) : Int
22-
fun pthread_key_create(PthreadKeyT*, (Void*) ->) : Int
23-
fun pthread_key_delete(PthreadKeyT) : Int
2421
fun pthread_mutexattr_destroy(x0 : PthreadMutexattrT*) : Int
2522
fun pthread_mutexattr_init(x0 : PthreadMutexattrT*) : Int
2623
fun pthread_mutexattr_settype(x0 : PthreadMutexattrT*, x1 : Int) : Int
@@ -31,5 +28,4 @@ lib LibC
3128
fun pthread_mutex_unlock(x0 : PthreadMutexT*) : Int
3229
fun pthread_self : PthreadT
3330
fun pthread_setname_np(PthreadT, Char*) : Int
34-
fun pthread_setspecific(PthreadKeyT, Void*) : Int
3531
end

0 commit comments

Comments
 (0)