Last active
August 29, 2015 14:22
-
-
Save ramytamer/e0e2618e9ff64ea4cefa to your computer and use it in GitHub Desktop.
Threads (pthread)
This file contains hidden or 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
| //////////////////// | |
| // Thread pthread // | |
| //////////////////// | |
| /** | |
| * Define a thread | |
| */ | |
| pthread_t thread; | |
| /** | |
| * Create a thread | |
| * if( pthread_create != 0) return err; | |
| */ | |
| pthread_create(&thread, NULL, (void *) functionToBeRun, (void *) argument); | |
| /** | |
| * Join Thread | |
| * if( pthread_join != 0 ) return err; | |
| */ | |
| pthread_join(thread, NULL); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment