Initialize pthread according to CID 1375950.
Details
Details
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 9810 Build 10245: arc lint + arc unit
Event Timeline
Comment Actions
I don't think it's valid to pthread_join() a bogus pthread_t value, which isn't even necessarily a scalar type. I'd just use a new bool value, set it to true when the thread is created, and check before joining the tid value.
usr.sbin/bhyve/rfb.c | ||
---|---|---|
919–920 | Yes, you are right! I overlooked that. |
Comment Actions
Rewrite the attempt to fix CID 1375950.
I made couple tests using 'procstat -Ht <pid>' and also clang
static analisys didn't get anything else related with
the pthread_create(3).
Comment Actions
This addresses the Coverity warning, thanks! I'm not sure pthread_create failure is actually handled correctly, though.
usr.sbin/bhyve/rfb.c | ||
---|---|---|
883–886 | Does it make sense to proceed here if pthread_create failed? Maybe instead: if (perror != 0) goto done; pthread_set_name_np(...); |