Lib/ThreadTest/ThreadTest.cpp
static IntrusiveSharedPtr<Thread> removeThreadById(Uptr threadId)
{
	IntrusiveSharedPtr<Thread> thread;

	Platform::Mutex::Lock threadsLock(threadsMutex);
	validateThreadId(threadId);
	thread = std::move(threads[threadId]);
	threads.removeOrFail(threadId);

	WAVM_ASSERT(thread->id == Uptr(threadId));
	thread->id = UINTPTR_MAX;

	return thread;
}
// Validates a thread ID, removes the corresponding thread from the threads array, and returns it.
Validates a thread ID, removes the corresponding thread from the threads array, and returns it.
Validates a thread ID removes the corresponding thread from the threads array and returns it .
static IntrusiveSharedPtr<Thread> removeThreadById(Uptr threadId)
{
	IntrusiveSharedPtr<Thread> thread;
	Platform::Mutex::Lock threadsLock(threadsMutex);
	validateThreadId(threadId);
	thread = std::move(threads[threadId]);
	threads.removeOrFail(threadId);
	WAVM_ASSERT(thread->id == Uptr(threadId));
	thread->id = UINTPTR_MAX;
	return thread;
}
static IntrusiveSharedPtr < Thread > removeThreadById ( Uptr threadId ) { IntrusiveSharedPtr < Thread > thread ; Platform :: Mutex :: Lock threadsLock ( threadsMutex ) ; validateThreadId ( threadId ) ; thread = std :: move ( threads [ threadId ] ) ; threads . removeOrFail ( threadId ) ; WAVM_ASSERT ( thread -> id == Uptr ( threadId ) ) ; thread -> id = UINTPTR_MAX ; return thread ; }
Validates a thread ID, removes the corresponding thread from the threads array, and returns it.
Validates a thread ID removes the corresponding thread from the threads array and returns it .