include/threads: Prevent operator precedence issues

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
This commit is contained in:
Gustavo Henrique Nihei 2021-08-30 18:22:08 -03:00 committed by Xiang Xiao
parent b628d92e63
commit 270e9196c6

View File

@ -106,14 +106,14 @@ typedef CODE void (*tss_dtor_t)(FAR void *);
*/
#define thrd_create(thr,func,arg) \
pthread_create(thr,NULL,(pthread_startroutine_t)func,arg)
pthread_create(thr,NULL,(pthread_startroutine_t)(func),arg)
/* thrd_equal: checks if two identifiers refer to the same thread
*
* int thrd_equal(thrd_t lhs, thrd_t rhs);
*/
#define thrd_equal(lhs,rhs) (lhs == rhs)
#define thrd_equal(lhs,rhs) ((lhs) == (rhs))
/* thrd_current: obtains the current thread identifier
*
@ -143,7 +143,7 @@ typedef CODE void (*tss_dtor_t)(FAR void *);
* _Noreturn void thrd_exit(int res);
*/
#define thrd_exit(res) pthread_exit((pthread_addr_t)res)
#define thrd_exit(res) pthread_exit((pthread_addr_t)(res))
/* thrd_detach: detaches a thread
*