A streamlined version (for embedded use) of Jeff Brown's ZBar library. Visit <http://zbar.sourceforge.net> for more details.

Dependents:   BarcodeReader_F103

Committer:
hudakz
Date:
Fri Jan 10 22:06:18 2020 +0000
Revision:
1:4f5c042a2d34
Parent:
0:e33621169e44
Streamlined barcode reader library.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hudakz 0:e33621169e44 1 /*------------------------------------------------------------------------
hudakz 0:e33621169e44 2 * Copyright 2007-2009 (c) Jeff Brown <spadix@users.sourceforge.net>
hudakz 0:e33621169e44 3 *
hudakz 0:e33621169e44 4 * This file is part of the ZBar Bar Code Reader.
hudakz 0:e33621169e44 5 *
hudakz 0:e33621169e44 6 * The ZBar Bar Code Reader is free software; you can redistribute it
hudakz 0:e33621169e44 7 * and/or modify it under the terms of the GNU Lesser Public License as
hudakz 0:e33621169e44 8 * published by the Free Software Foundation; either version 2.1 of
hudakz 0:e33621169e44 9 * the License, or (at your option) any later version.
hudakz 0:e33621169e44 10 *
hudakz 0:e33621169e44 11 * The ZBar Bar Code Reader is distributed in the hope that it will be
hudakz 0:e33621169e44 12 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
hudakz 0:e33621169e44 13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
hudakz 0:e33621169e44 14 * GNU Lesser Public License for more details.
hudakz 0:e33621169e44 15 *
hudakz 0:e33621169e44 16 * You should have received a copy of the GNU Lesser Public License
hudakz 0:e33621169e44 17 * along with the ZBar Bar Code Reader; if not, write to the Free
hudakz 0:e33621169e44 18 * Software Foundation, Inc., 51 Franklin St, Fifth Floor,
hudakz 0:e33621169e44 19 * Boston, MA 02110-1301 USA
hudakz 0:e33621169e44 20 *
hudakz 0:e33621169e44 21 * http://sourceforge.net/projects/zbar
hudakz 0:e33621169e44 22 *------------------------------------------------------------------------*/
hudakz 0:e33621169e44 23
hudakz 0:e33621169e44 24 #include "refcnt.h"
hudakz 0:e33621169e44 25
hudakz 0:e33621169e44 26 #ifdef HAVE_LIBPTHREAD
hudakz 0:e33621169e44 27
hudakz 0:e33621169e44 28 pthread_once_t initialized = PTHREAD_ONCE_INIT;
hudakz 0:e33621169e44 29 pthread_mutex_t _zbar_reflock;
hudakz 0:e33621169e44 30
hudakz 0:e33621169e44 31 static void initialize (void)
hudakz 0:e33621169e44 32 {
hudakz 0:e33621169e44 33 pthread_mutex_init(&_zbar_reflock, NULL);
hudakz 0:e33621169e44 34 }
hudakz 0:e33621169e44 35
hudakz 0:e33621169e44 36 void _zbar_refcnt_init ()
hudakz 0:e33621169e44 37 {
hudakz 0:e33621169e44 38 pthread_once(&initialized, initialize);
hudakz 0:e33621169e44 39 }
hudakz 0:e33621169e44 40
hudakz 0:e33621169e44 41
hudakz 0:e33621169e44 42 #else
hudakz 0:e33621169e44 43
hudakz 0:e33621169e44 44 void _zbar_refcnt_init ()
hudakz 0:e33621169e44 45 {
hudakz 0:e33621169e44 46 }
hudakz 0:e33621169e44 47
hudakz 0:e33621169e44 48 #endif