Skip to content

Commit 55195b7

Browse files
committedMar 19, 2019
semaphore: correct the size of semaphore for LLP64
The `dsema_value` field was marked as long which is incorrect for LLP64 environments. Update the type to `intptr_t` which is the portable type for this value.
1 parent 1428c6d commit 55195b7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎src/queue.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ dispatch_block_testcancel(dispatch_block_t db)
571571
return (bool)(dbpd->dbpd_atomic_flags & DBF_CANCELED);
572572
}
573573

574-
long
574+
intptr_t
575575
dispatch_block_wait(dispatch_block_t db, dispatch_time_t timeout)
576576
{
577577
dispatch_block_private_data_t dbpd = _dispatch_block_get_data(db);

‎src/semaphore_internal.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct dispatch_queue_s;
3232
DISPATCH_CLASS_DECL(semaphore, OBJECT);
3333
struct dispatch_semaphore_s {
3434
DISPATCH_OBJECT_HEADER(semaphore);
35-
long volatile dsema_value;
35+
intptr_t volatile dsema_value;
3636
intptr_t dsema_orig;
3737
_dispatch_sema4_t dsema_sema;
3838
};

0 commit comments

Comments
 (0)