Created
November 24, 2021 04:49
-
-
Save u-r-w/fb5a07a3eb54b59b3678d7ba496731c3 to your computer and use it in GitHub Desktop.
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
#include <stdio.h> | |
#include <pthread.h> | |
#include <unistd.h> | |
// unmark pthread_detach(), memory leak will be gone | |
void* process( void* data ) { | |
printf( "hello world\n" ); | |
} | |
main() { | |
pthread_t th; | |
pthread_create( &th, NULL, process, NULL ); | |
sleep( 1 ); | |
// pthread_detach( th ); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment