|
Packit |
5e354d |
/* t-mutex.c
|
|
Packit |
5e354d |
* Copyright 2011, 2012 g10 Code GmbH
|
|
Packit |
5e354d |
*
|
|
Packit |
5e354d |
* This file is free software; as a special exception the author gives
|
|
Packit |
5e354d |
* unlimited permission to copy and/or distribute it, with or without
|
|
Packit |
5e354d |
* modifications, as long as this notice is preserved.
|
|
Packit |
5e354d |
*
|
|
Packit |
5e354d |
* This file is distributed in the hope that it will be useful, but
|
|
Packit |
5e354d |
* WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
|
Packit |
5e354d |
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
Packit |
5e354d |
*/
|
|
Packit |
5e354d |
|
|
Packit |
5e354d |
#include "t-support.h"
|
|
Packit |
5e354d |
|
|
Packit |
5e354d |
|
|
Packit |
5e354d |
int
|
|
Packit |
5e354d |
main (int argc, char *argv[])
|
|
Packit |
5e354d |
{
|
|
Packit |
5e354d |
int rc;
|
|
Packit |
5e354d |
npth_mutex_t mutex;
|
|
Packit |
5e354d |
|
|
Packit |
5e354d |
rc = npth_init ();
|
|
Packit |
5e354d |
fail_if_err (rc);
|
|
Packit |
5e354d |
|
|
Packit |
5e354d |
rc = npth_mutex_init (&mutex, NULL);
|
|
Packit |
5e354d |
fail_if_err (rc);
|
|
Packit |
5e354d |
rc = npth_mutex_lock (&mutex);
|
|
Packit |
5e354d |
fail_if_err (rc);
|
|
Packit |
5e354d |
rc = npth_mutex_unlock (&mutex);
|
|
Packit |
5e354d |
fail_if_err (rc);
|
|
Packit |
5e354d |
|
|
Packit |
5e354d |
return 0;
|
|
Packit |
5e354d |
}
|