Back to index

glibc  2.9
Defines | Functions
tst-spin1.c File Reference
#include <pthread.h>
#include <stdio.h>
#include "../test-skeleton.c"

Go to the source code of this file.

Defines

#define TEST_FUNCTION   do_test ()

Functions

static int do_test (void)

Define Documentation

#define TEST_FUNCTION   do_test ()

Definition at line 56 of file tst-spin1.c.


Function Documentation

static int do_test ( void  ) [static]

Definition at line 25 of file tst-spin1.c.

{
  pthread_spinlock_t s;

  if (pthread_spin_init (&s, PTHREAD_PROCESS_PRIVATE) != 0)
    {
      puts ("spin_init failed");
      return 1;
    }

  if (pthread_spin_lock (&s) != 0)
    {
      puts ("spin_lock failed");
      return 1;
    }

  if (pthread_spin_unlock (&s) != 0)
    {
      puts ("spin_unlock failed");
      return 1;
    }

  if (pthread_spin_destroy (&s) != 0)
    {
      puts ("spin_destroy failed");
      return 1;
    }

  return 0;
}

Here is the call graph for this function: