Hello Rumen,
as you discovered, the thread capability is merely a low-level mechanism. It should normally not be used directly.
Is there a function similar to the one above that will work for Linux?
To kill a thread, destruct the 'Thread` object. Without precautions, however, this brutal method may still have unwelcome side effects as the killed thread may be in an intermediate state like holding a lock. A thread killing itself is a no-go because its execution might crease mid-way during its destruction, provoking inconsistencies like a missing release of the thread's stack.
It is best to have a clear notion of ownership. The one thread who creates another thread should be the one destroying it.
For the destruction, it is advisable to implement a clean wind-down procedure (e.g., the to-be-killed thread signals its owner that it is ready to be destructed) and let the owner call 'Thread::join' before destructing the 'Thread' object.
Cheers Norman