Anonymous | Login | 2024-12-04 06:28 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Type | Date Submitted | Last Update | ||
0000599 | [1003.1(2008)/Issue 7] System Interfaces | Comment | Enhancement Request | 2012-08-08 22:39 | 2024-06-11 08:52 | ||
Reporter | mdempsky | View Status | public | ||||
Assigned To | ajosey | ||||||
Priority | normal | Resolution | Accepted As Marked | ||||
Status | Closed | ||||||
Name | Matthew Dempsky | ||||||
Organization | OpenBSD | ||||||
User Reference | |||||||
Section | pthread.h, pthread_equal | ||||||
Page Number | N/A | ||||||
Line Number | N/A | ||||||
Interp Status | --- | ||||||
Final Accepted Text | Note: 0001334 | ||||||
Summary | 0000599: Reserved "no thread" value for pthread_t | ||||||
Description |
Some software currently non-portably assumes pthread_t is an int or pointer type and also that they can use "0" to represent an illegal thread value (similar to how -1 is used for an illegal file descriptor value). E.g., from the Chromium code base: #elif defined(OS_POSIX) typedef pthread_t PlatformThreadHandle; const PlatformThreadHandle kNullThreadHandle = 0; typedef pid_t PlatformThreadId; #endif It would be convenient if POSIX were to add a macro or function that could return a pthread_t value that was guaranteed to compare unequal by pthread_equal() to any valid thread ID. |
||||||
Desired Action |
Change <pthread.h> to define a constant expression PTHREAD_NULL of type pthread_t. Change pthread_equal() to return true if t1 and t2 are the same thread ID or are both PTHREAD_NULL; it's behavior is undefined if either t1 or t2 are neither a valid thread ID or PTHREAD_NULL. (My intent here is to allow PTHREAD_NULL to be defined simply as "#define PTHREAD_NULL NULL" on systems where pthread_t is a pointer type, but to allow something like "extern const pthread_t PTHREAD_NULL;" on systems where pthread_t is a struct.) |
||||||
Tags | issue8 | ||||||
Attached Files | |||||||
|
Issue History | |||
Date Modified | Username | Field | Change |
2012-08-08 22:39 | mdempsky | New Issue | |
2012-08-08 22:39 | mdempsky | Status | New => Under Review |
2012-08-08 22:39 | mdempsky | Assigned To | => ajosey |
2012-08-08 22:39 | mdempsky | Name | => Matthew Dempsky |
2012-08-08 22:39 | mdempsky | Organization | => OpenBSD |
2012-08-08 22:39 | mdempsky | Section | => pthread.h, pthread_equal |
2012-08-08 22:39 | mdempsky | Page Number | => N/A |
2012-08-08 22:39 | mdempsky | Line Number | => N/A |
2012-08-09 14:25 | wlerch | Note Added: 0001323 | |
2012-08-10 18:12 | mdempsky | Note Added: 0001324 | |
2012-08-10 18:23 | mdempsky | Note Added: 0001325 | |
2012-08-15 16:28 | eblake | Note Added: 0001326 | |
2012-08-16 15:15 | mdempsky | Note Added: 0001328 | |
2012-08-16 16:09 | geoffclare | Note Added: 0001329 | |
2012-08-29 15:58 | msbrown | Note Added: 0001334 | |
2012-08-29 15:59 | msbrown | Tag Attached: issue8 | |
2012-08-29 16:01 | msbrown | Note Edited: 0001334 | |
2012-08-29 16:03 | msbrown | Interp Status | => --- |
2012-08-29 16:03 | msbrown | Final Accepted Text | => Note: 0001334 |
2012-08-29 16:03 | msbrown | Status | Under Review => Resolved |
2012-08-29 16:03 | msbrown | Resolution | Open => Accepted As Marked |
2020-03-20 10:04 | geoffclare | Note Added: 0004799 | |
2020-03-20 10:04 | geoffclare | Status | Resolved => Applied |
2024-06-11 08:52 | agadmin | Status | Applied => Closed |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |