Skip to content

Instantly share code, notes, and snippets.

@alashstein
Created November 24, 2021 04:49
Show Gist options
  • Save alashstein/fb5a07a3eb54b59b3678d7ba496731c3 to your computer and use it in GitHub Desktop.
Save alashstein/fb5a07a3eb54b59b3678d7ba496731c3 to your computer and use it in GitHub Desktop.
#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