correctly set modified flag after auto-save
[claws.git] / src / etpan / etpan-thread-manager-types.h
blob264873ede7c9333cff2a0d9c3ef9cf2b52825030
1 /*
2 * Claws Mail -- a GTK based, lightweight, and fast e-mail client
3 * Copyright (C) 2005-2012 DINH Viet Hoa and the Claws Mail team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef ETPAN_THREAD_MANAGER_TYPES_H
22 #define ETPAN_THREAD_MANAGER_TYPES_H
24 #include <pthread.h>
25 #include <libetpan/libetpan.h>
27 struct etpan_thread_manager {
28 /* thread pool */
29 carray * thread_pool;
30 carray * thread_pending;
31 int can_create_thread;
33 int unbound_count;
35 int notify_fds[2];
38 struct etpan_thread {
39 struct etpan_thread_manager * manager;
41 pthread_t th_id;
43 pthread_mutex_t lock;
44 carray * op_list;
45 carray * op_done_list;
47 int bound_count;
48 int terminate_state;
50 struct mailsem * start_sem;
51 struct mailsem * stop_sem;
52 struct mailsem * op_sem;
55 struct etpan_thread_op {
56 struct etpan_thread * thread;
58 void (* run)(struct etpan_thread_op * op);
60 void (* callback)(int cancelled, void * result, void * callback_data);
61 void * callback_data;
63 void (* cleanup)(struct etpan_thread_op * op);
65 pthread_mutex_t lock;
66 int callback_called;
67 int cancellable;
68 int cancelled;
69 void * param;
70 void * result;
71 int finished;
72 mailimap *imap;
73 newsnntp *nntp;
76 #endif