8

C: Manipulate a structure declaired in the main from a created thread without the use of global variables

view full story
linux-howto

http://stackoverflow.com – I'm trying to understand the use of threads in an application (I'm aware what I'm doing may be stupid in some sense) and I'm trying to understand how to manipulate variables declared in a structure in main from a created thread. So far i have: The structure is called declared server. if (pthread_create(&server->thread_id, (void *) &server->thread_attribute, &server_runtime, &server)) { perror("Creating main thread"); } . void *server_runtime(void *server) { server->server_stats.active_connections = 1; } I just made the = 1 so (HowTos)