Skip to content

Instantly share code, notes, and snippets.

@jgreco
Created June 14, 2012 21:14
Show Gist options
  • Save jgreco/2932994 to your computer and use it in GitHub Desktop.
Save jgreco/2932994 to your computer and use it in GitHub Desktop.
thread macro
#define THREAD(thread_id, fun, ...) \
__extension__ pthread_create(thread_id, NULL, ({ \
void *func() { \
fun(__VA_ARGS__); \
return NULL; \
} \
func;\
}), NULL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment