avoid all malloc/free in timer creation/destruction
instead of allocating a userspace structure for signal-based timers, simply use the kernel timer id. we use the fact that thread pointers will always be zero in the low bit (actually more) to encode integer timerid values as pointers. also, this change ensures that the timer_destroy syscall has completed before the library timer_destroy function returns, in case it matters.
This commit is contained in:
parent
b8be64c43d
commit
3990c5c6a4
7 changed files with 22 additions and 31 deletions
|
|
@ -107,7 +107,7 @@ TYPEDEF long long blkcnt_t;
|
|||
TYPEDEF unsigned long long fsblkcnt_t;
|
||||
TYPEDEF unsigned long long fsfilcnt_t;
|
||||
|
||||
TYPEDEF struct __timer * timer_t;
|
||||
TYPEDEF void * timer_t;
|
||||
TYPEDEF int clockid_t;
|
||||
TYPEDEF unsigned long clock_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ TYPEDEF long long blkcnt_t;
|
|||
TYPEDEF unsigned long long fsblkcnt_t;
|
||||
TYPEDEF unsigned long long fsfilcnt_t;
|
||||
|
||||
TYPEDEF struct __timer * timer_t;
|
||||
TYPEDEF void * timer_t;
|
||||
TYPEDEF int clockid_t;
|
||||
TYPEDEF long clock_t;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue