mirror of
				https://github.com/glfw/glfw.git
				synced 2025-11-04 14:16:42 +00:00 
			
		
		
		
	Decreased nesting in threads test.
This commit is contained in:
		
							parent
							
								
									ac3a5e28c9
								
							
						
					
					
						commit
						4057885ac3
					
				@ -77,20 +77,18 @@ int main(void)
 | 
				
			|||||||
        exit(EXIT_FAILURE);
 | 
					        exit(EXIT_FAILURE);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (thrd_create(&thread, thread_start, window) == thrd_success)
 | 
					    if (thrd_create(&thread, thread_start, window) != thrd_success)
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        while (!glfwGetWindowParam(window, GLFW_CLOSE_REQUESTED))
 | 
					 | 
				
			||||||
            glfwWaitEvents();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        running = GL_FALSE;
 | 
					 | 
				
			||||||
        thrd_join(thread, &result);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    else
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        fprintf(stderr, "Failed to create secondary thread\n");
 | 
					        fprintf(stderr, "Failed to create secondary thread\n");
 | 
				
			||||||
        exit(EXIT_FAILURE);
 | 
					        exit(EXIT_FAILURE);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    while (!glfwGetWindowParam(window, GLFW_CLOSE_REQUESTED))
 | 
				
			||||||
 | 
					        glfwWaitEvents();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    running = GL_FALSE;
 | 
				
			||||||
 | 
					    thrd_join(thread, &result);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    exit(EXIT_SUCCESS);
 | 
					    exit(EXIT_SUCCESS);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user