run clang-format
This commit is contained in:
@@ -4,26 +4,27 @@
|
||||
* Demonstrate detection of errors from a typical POSIX 1003.1c-1995
|
||||
* function, pthread_join.
|
||||
*/
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
int
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
pthread_t thread;
|
||||
int status;
|
||||
pthread_t thread;
|
||||
int status;
|
||||
|
||||
/*
|
||||
* Attempt to join with an uninitialized thread ID. On most
|
||||
* implementations, this will return an ESRCH error code. If
|
||||
* the local (and uninitialized) pthread_t happens to be a valid
|
||||
* thread ID, it is almost certainly that of the initial thread,
|
||||
* which is running main(). In that case, your Pthreads
|
||||
* implementation may either return EDEADLK (self-deadlock),
|
||||
* or it may hang. If it hangs, quit and try again.
|
||||
*/
|
||||
status = pthread_join (thread, NULL);
|
||||
if (status != 0)
|
||||
fprintf (stderr, "error %d: %s\n", status, strerror (status));
|
||||
return status;
|
||||
/*
|
||||
* Attempt to join with an uninitialized thread ID. On most
|
||||
* implementations, this will return an ESRCH error code. If
|
||||
* the local (and uninitialized) pthread_t happens to be a valid
|
||||
* thread ID, it is almost certainly that of the initial thread,
|
||||
* which is running main(). In that case, your Pthreads
|
||||
* implementation may either return EDEADLK (self-deadlock),
|
||||
* or it may hang. If it hangs, quit and try again.
|
||||
*/
|
||||
status = pthread_join(thread, NULL);
|
||||
if (status != 0)
|
||||
fprintf(stderr, "error %d: %s\n", status, strerror(status));
|
||||
return status;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user