LCOV - code coverage report
Current view: directory - src/shared/platform/posix - nacl_fast_mutex.c (source / functions) Found Hit Coverage
Test: coverage.lcov Lines: 16 13 81.2 %
Date: 2014-06-18 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            5116 : int NaClFastMutexCtor(struct NaClFastMutex *flp) {
      12            5116 :   if (0 != pthread_mutex_init(&flp->mu, (pthread_mutexattr_t *) NULL)) {
      13               0 :     return 0;
      14                 :   }
      15            5116 :   return 1;
      16            5116 : }
      17                 : 
      18            1183 : void NaClFastMutexDtor(struct NaClFastMutex *flp) {
      19            1183 :   pthread_mutex_destroy(&flp->mu);
      20            1183 : }
      21                 : 
      22          246816 : void NaClFastMutexLock(struct NaClFastMutex *flp) {
      23          740447 :   CHECK(0 == pthread_mutex_lock(&flp->mu));
      24          246816 : }
      25                 : 
      26               0 : int NaClFastMutexTryLock(struct NaClFastMutex *flp) {
      27               0 :   return NaClXlateErrno(pthread_mutex_trylock(&flp->mu));
      28                 : }
      29                 : 
      30          246814 : void NaClFastMutexUnlock(struct NaClFastMutex *flp) {
      31          740439 :   CHECK(0 == pthread_mutex_unlock(&flp->mu));
      32          246814 : }

Generated by: LCOV version 1.7