#ifdef USE_PTHREAD
thread_data *td = g_new0(thread_data, 1);
pthread_t pt;
- pthread_attr_t pta;
void *res = NULL;
time_t start_time = time(NULL);
gboolean killed = FALSE;
/* try to create a thread to initialize the SSL connection,
* fallback to blocking method in case of problem
*/
- if (pthread_attr_init(&pta) != 0 ||
- pthread_attr_setdetachstate(&pta, PTHREAD_CREATE_JOINABLE) != 0 ||
- pthread_create(&pt, &pta, SSL_connect_thread, td) != 0) {
+ if (pthread_create(&pt, NULL, SSL_connect_thread, td) != 0) {
do {
result = gnutls_handshake(td->ssl);
} while (result == GNUTLS_E_AGAIN || result == GNUTLS_E_INTERRUPTED);
ctx->done = FALSE;
#ifdef USE_PTHREAD
- if (pthread_create(&pt, PTHREAD_CREATE_JOINABLE, threaded_GetOpenFileName,
+ if (pthread_create(&pt, NULL, threaded_GetOpenFileName,
(void *)ctx) != 0) {
debug_print("Couldn't run in a thread, continuing unthreaded.\n");
threaded_GetOpenFileName(ctx);
ctx->done = FALSE;
#ifdef USE_PTHREAD
- if (pthread_create(&pt, PTHREAD_CREATE_JOINABLE, threaded_GetSaveFileName,
+ if (pthread_create(&pt, NULL, threaded_GetSaveFileName,
(void *)ctx) != 0) {
debug_print("Couldn't run in a thread, continuing unthreaded.\n");
threaded_GetSaveFileName(ctx);
ctx->done = FALSE;
#ifdef USE_PTHREAD
- if (pthread_create(&pt, PTHREAD_CREATE_JOINABLE, threaded_SHBrowseForFolder,
+ if (pthread_create(&pt, NULL, threaded_SHBrowseForFolder,
(void *)ctx) != 0) {
debug_print("Couldn't run in a thread, continuing unthreaded.\n");
threaded_SHBrowseForFolder(ctx);
gint retval;
#ifdef USE_PTHREAD
pthread_t pt;
- pthread_attr_t pta;
thread_data *td = g_new0(thread_data, 1);
void *res = NULL;
time_t start_time = time(NULL);
td->cmd = cmd;
td->done = FALSE;
- if (pthread_attr_init(&pta) != 0 ||
- pthread_attr_setdetachstate(&pta, PTHREAD_CREATE_JOINABLE) != 0 ||
- pthread_create(&pt, &pta, matcher_test_thread, td) != 0)
+ if (pthread_create(&pt, NULL, matcher_test_thread, td) != 0)
retval = system(cmd);
else {
debug_print("waiting for test thread\n");
filter_th_done = FALSE;
if (filter_th != 0 || 1)
return;
- if (pthread_create(&filter_th, 0,
+ if (pthread_create(&filter_th, NULL,
bogofilter_filtering_thread,
NULL) != 0) {
filter_th = 0;
filter_th_done = FALSE;
if (filter_th_started != 0)
return;
- if (pthread_create(&filter_th, 0,
+ if (pthread_create(&filter_th, NULL,
bsfilter_filtering_thread,
NULL) != 0) {
filter_th_started = 0;
g_return_val_if_fail(ctx != NULL, NULL);
#ifdef USE_PTHREAD
- if (pthread_create(&pt, PTHREAD_CREATE_JOINABLE, get_image_thread, (void *)ctx) != 0) {
+ if (pthread_create(&pt, NULL, get_image_thread, (void *)ctx) != 0) {
debug_print("synchronous image fetching (couldn't create thread)\n");
get_image_thread(ctx);
} else {
ctx->exitcode = STILL_ACTIVE;
ctx->cmd = cmd;
- if (pthread_create(&pt, PTHREAD_CREATE_JOINABLE,
+ if (pthread_create(&pt, NULL,
_import_threaded, (void *)ctx) != 0) {
debug_print("Couldn't create thread, continuing unthreaded.\n");
_import_threaded(ctx);
ectx->exitcode = STILL_ACTIVE;
ectx->cmd = cmd;
- if (pthread_create(&pt, PTHREAD_CREATE_JOINABLE,
+ if (pthread_create(&pt, NULL,
_export_threaded, (void *)ectx) != 0) {
debug_print("Couldn't create thread, continuing unthreaded.\n");
_export_threaded(ctx);
ctx->ritem = ritem;
ctx->ready = FALSE;
- if( pthread_create(&pt, PTHREAD_CREATE_JOINABLE, rssyl_read_existing_thr,
+ if( pthread_create(&pt, NULL, rssyl_read_existing_thr,
(void *)ctx) != 0 ) {
/* Couldn't create thread, let's continue non-threaded. */
rssyl_folder_read_existing_real(ritem);
g_return_if_fail(ctx != NULL);
#ifdef USE_PTHREAD
- if( pthread_create(&pt, PTHREAD_CREATE_JOINABLE, rssyl_fetch_feed_thr,
+ if( pthread_create(&pt, NULL, rssyl_fetch_feed_thr,
(void *)ctx) != 0 ) {
/* Bummer, couldn't create thread. Continue non-threaded. */
rssyl_fetch_feed_thr(ctx);
thread_data *td;
#ifdef USE_PTHREAD
pthread_t pt;
- pthread_attr_t pta;
#endif
void *res;
gchar *error = NULL;
STATUSBAR_PUSH(mainwindow_get_mainwindow(), label);
#ifdef USE_PTHREAD
- if (pthread_attr_init(&pta) != 0 ||
- pthread_attr_setdetachstate(&pta, PTHREAD_CREATE_JOINABLE) != 0 ||
- pthread_create(&pt, &pta,
- url_read_thread, td) != 0) {
+ if (pthread_create(&pt, NULL, url_read_thread, td) != 0) {
url_read_thread(td);
}
while (!td->done) {