Can I use normal posix threads in Kotlin Native an...
# kotlin-native
a
Can I use normal posix threads in Kotlin Native and pass data to them? I'm trying the following:
Copy code
val longVar = nativeHeap.alloc<LongVar>().apply { value = 1234 }
val thread = nativeHeap.alloc<pthread_tVar>()
pthread_create(
		thread.ptr,
		null,
		staticCFunction { inPtr: COpaquePointer? ->
			println("staticCFunction")
			println("inPtr: $inPtr")
			null as COpaquePointer?
		},
		longVar.ptr
)
The first
println
succeeds, but it appears that as soon as I try to do anything whatsoever with
inPtr
I get a Segmentation fault?