tesseract  4.0.0-beta.1-59-g2cc4
ccutil.cpp
Go to the documentation of this file.
1 // Copyright 2008 Google Inc. All Rights Reserved.
2 // Author: scharron@google.com (Samuel Charron)
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 // http://www.apache.org/licenses/LICENSE-2.0
7 // Unless required by applicable law or agreed to in writing, software
8 // distributed under the License is distributed on an "AS IS" BASIS,
9 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 // See the License for the specific language governing permissions and
11 // limitations under the License.
12 
13 #include "ccutil.h"
14 
15 namespace tesseract {
17  params_(),
18 #ifdef _WIN32
19  STRING_INIT_MEMBER(tessedit_module_name, WINDLLNAME,
20  "Module colocated with tessdata dir", &params_),
21 #endif
22  INT_INIT_MEMBER(ambigs_debug_level, 0, "Debug level for unichar ambiguities",
23  &params_),
24  BOOL_MEMBER(use_definite_ambigs_for_classifier, 0, "Use definite"
25  " ambiguities when running character classifier", &params_),
26  BOOL_MEMBER(use_ambigs_for_adaption, 0, "Use ambigs for deciding"
27  " whether to adapt to a character", &params_) {
28 }
29 
31 }
32 
33 
35 #ifdef _WIN32
36  mutex_ = CreateMutex(0, FALSE, 0);
37 #else
38  pthread_mutex_init(&mutex_, NULL);
39 #endif
40 }
41 
43 #ifdef _WIN32
44  WaitForSingleObject(mutex_, INFINITE);
45 #else
46  pthread_mutex_lock(&mutex_);
47 #endif
48 }
49 
51 #ifdef _WIN32
52  ReleaseMutex(mutex_);
53 #else
54  pthread_mutex_unlock(&mutex_);
55 #endif
56 }
57 
58 CCUtilMutex tprintfMutex; // should remain global
59 } // namespace tesseract
#define BOOL_MEMBER(name, val, comment, vec)
Definition: params.h:303
CCUtilMutex tprintfMutex
Definition: ccutil.cpp:58
virtual ~CCUtil()
Definition: ccutil.cpp:30
#define FALSE
Definition: capi.h:46
#define INT_INIT_MEMBER(name, val, comment, vec)
Definition: params.h:312
#define STRING_INIT_MEMBER(name, val, comment, vec)
Definition: params.h:318