Page MenuHomeFreeBSD

libthr: Robust tryjoin test
Needs ReviewPublic

Authored by aokblast on Sun, Oct 18, 2:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 19, 3:44 AM
Unknown Object (File)
Mon, Oct 19, 1:06 AM
Unknown Object (File)
Sun, Oct 18, 10:45 PM
Unknown Object (File)
Sun, Oct 18, 11:02 AM
Unknown Object (File)
Sun, Oct 18, 11:02 AM
Unknown Object (File)
Sun, Oct 18, 11:02 AM
Unknown Object (File)
Sun, Oct 18, 5:47 AM
Unknown Object (File)
Sun, Oct 18, 5:34 AM
Subscribers

Details

Reviewers
kib
markj
Summary

We cannot actually rely on a status (finish) before thr_exit. The
thread needs the kernel signal status=1 to userspace. Before that,
any tryjoin fails. The previous one works as we sleep 1 and should be
enough for normal case.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 78328
Build 75211: arc lint + arc unit

Event Timeline

You could query the kernel to see the state of the thread using kinfo_proc().

Somewhat curiously, I thought about adding an API to query the list of the threads for the current process.

In D60832#1395064, @kib wrote:

Somewhat curiously, I thought about adding an API to query the list of the threads for the current process.

D60838

In D60832#1395064, @kib wrote:

You could query the kernel to see the state of the thread using kinfo_proc().

Somewhat curiously, I thought about adding an API to query the list of the threads for the current process.

Yes, but it is a test for pthread_tryjoin_np so :).

In D60832#1395064, @kib wrote:

You could query the kernel to see the state of the thread using kinfo_proc().

Somewhat curiously, I thought about adding an API to query the list of the threads for the current process.

Yes, but it is a test for pthread_tryjoin_np so :).

I do not understand what do you intended to say by this sentence.