00001 /******************************************************************************* 00002 This file is part of mdictionary. 00003 00004 mdictionary is free software; you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or 00007 (at your option) any later version. 00008 00009 mdictionary is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with mdictionary; if not, write to the Free Software 00016 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00017 00018 Copyright 2006-2008 ComArch S.A. 00019 *******************************************************************************/ 00026 #ifndef _WS_MANAGER_THREADS_UTILS 00027 #define _WS_MANAGER_THREADS_UTILS 00028 00029 #include <ws_manager.h> 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00037 00044 struct _WSMngSearchAtom { 00045 WSMngSearchData *data; 00047 gchar *word; 00049 GThread *thread; 00051 GArray *word_list; 00054 gchar *trans; 00057 }; 00058 00062 typedef struct _WSMngSearchAtom WSMngSearchAtom; 00063 00064 /* functions for critical sections and thread handling */ 00067 gboolean try_lock_was_locked(WSMngSearchData* data, gchar* fun); 00068 00071 gboolean is_rec_locked(GStaticRecMutex* m); 00072 00075 void stop_if_needed(WSMngSearchAtom* data); 00076 00079 void free_search_atom(WSMngSearchAtom* data); 00080 00083 WSMngSearchAtom *create_search_atom(WSMngSearchData* app_data, gchar* word); 00084 00087 #ifdef __cplusplus 00088 } 00089 #endif 00090 #endif 00091