Created
June 14, 2012 21:14
-
-
Save jgreco/2932994 to your computer and use it in GitHub Desktop.
thread macro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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