LCOV - code coverage report
Current view: directory - src/shared/platform/posix - nacl_fast_mutex.c (source / functions) Found Hit Coverage
Test: coverage.lcov Lines: 15 12 80.0 %
Date: 2014-10-23 Functions: 0 0 -

       1                 : /*
       2                 :  * Copyright (c) 2012 The Native Client Authors. All rights reserved.
       3                 :  * Use of this source code is governed by a BSD-style license that can be
       4                 :  * found in the LICENSE file.
       5                 :  */
       6                 : 
       7                 : #include "native_client/src/shared/platform/nacl_check.h"
       8                 : #include "native_client/src/shared/platform/nacl_host_desc.h"
       9                 : #include "native_client/src/shared/platform/posix/nacl_fast_mutex.h"
      10                 : 
      11            5114 : int NaClFastMutexCtor(struct NaClFastMutex *flp) {
      12            5114 :   if (0 != pthread_mutex_init(&flp->mu, (pthread_mutexattr_t *) NULL)) {
      13               0 :     return 0;
      14                 :   }
      15            5114 :   return 1;
      16                 : }
      17                 : 
      18            1210 : void NaClFastMutexDtor(struct NaClFastMutex *flp) {
      19            1210 :   pthread_mutex_destroy(&flp->mu);
      20            1210 : }
      21                 : 
      22          247759 : void NaClFastMutexLock(struct NaClFastMutex *flp) {
      23          247759 :   CHECK(0 == pthread_mutex_lock(&flp->mu));
      24          247813 : }
      25                 : 
      26               0 : int NaClFastMutexTryLock(struct NaClFastMutex *flp) {
      27               0 :   return NaClXlateErrno(pthread_mutex_trylock(&flp->mu));
      28                 : }
      29                 : 
      30          247779 : void NaClFastMutexUnlock(struct NaClFastMutex *flp) {
      31          247779 :   CHECK(0 == pthread_mutex_unlock(&flp->mu));
      32          247809 : }

Generated by: LCOV version 1.7