head 1.47; access; symbols PTH_2_0_7:1.46 PTH_2_0_6:1.45 PTH_2_0_5:1.45 PTH_2_0_4:1.45 PTH_2_0_3:1.44 PTH_2_0_2:1.44 PTH_2_0_1:1.44 PTH_2_0_0:1.43 PTH_2_0b2:1.42 PTH_2_0b1:1.42 PTH_2_0b0:1.42 PTH_1_4:1.40.0.2 PTH_1_4_1:1.40 PTH_1_4_0:1.39 PTH_1_3_7:1.38 PTH_1_4a3:1.38 PTH_1_3_6:1.38 PTH_1_4a2:1.38 PTH_1_3_5:1.38 PTH_1_4a1:1.38 PTH_1_3_4:1.38 PTH_1_3:1.38.0.2 PTH_1_3_3:1.38 PTH_1_3_2:1.37 PTH_1_3_1:1.37 PTH_1_3_0:1.37 PTH_1_3b3:1.36 PTH_1_2_3:1.32.2.2 PTH_1_3b2:1.36 PTH_1_3b1:1.36 PTH_1_3a5:1.36 PTH_1_3a4:1.35 PTH_1_3a3:1.35 PTH_1_2_2:1.32.2.1 PTH_1_3a2:1.35 PTH_1_2_1:1.32.2.1 PTH_1_3a1:1.33 PTH_1_2:1.32.0.2 PTH_1_2_0:1.32 PTH_1_2b8:1.31 PTH_1_2b7:1.30 PTH_1_1_6:1.29 PTH_1_2b6:1.30 PTH_1_2b5:1.30 PTH_1_2b4:1.30 PTH_1_2b3:1.30 PTH_1_2b2:1.29 PTH_1_2b1:1.29 PTH_1_1_5:1.29 PTH_1_0_6:1.27 PTH_1_0_5:1.27 PTH_1_0:1.27.0.2 PTH_1_1:1.29.0.2 PTH_1_1_4:1.29 PTH_1_1_3:1.29 PTH_1_1_2:1.29 PTH_1_1_1:1.29 PTH_1_1_0:1.29 PTH_1_1b7:1.29 PTH_1_1b6:1.29 PTH_1_1b5:1.29 PTH_1_1b4:1.28 PTH_1_1b3:1.28 PTH_1_1b2:1.28 PTH_1_1b1:1.28 PTH_1_0_4:1.27 PTH_1_0_3:1.27 PTH_1_0_2:1.27 PTH_1_0_1:1.27 PTH_1_0_0:1.25 PTH_1_0b8:1.25 PTH_1_0b7:1.25 PTH_1_0b6:1.25 PTH_1_0b5:1.25 PTH_1_0b4:1.24 PTH_1_0b3:1.22 PTH_1_0b2:1.22 PTH_1_0b1:1.21 PTH_0_9_21:1.20 PTH_0_9_20:1.19 PTH_0_9_19:1.17 PTH_0_9_18:1.17 PTH_0_9_17:1.16 PTH_0_9_16:1.16 PTH_0_9_15:1.16 PTH_0_9_14:1.16 PTH_0_9_13:1.15 PTH_0_9_12:1.13 PTH_0_9_11:1.11 PTH_0_9_10:1.11 PTH_0_9_9:1.11 PTH_0_9_8:1.10 PTH_0_9_7:1.6 PTH_0_9_6:1.5 PTH_0_9_5:1.2 PTH_0_9_4:1.1; locks; strict; comment @ * @; 1.47 date 2007.01.01.18.23.53; author rse; state Exp; branches; next 1.46; commitid 9DhdiirNzQPBIP0s; 1.46 date 2006.06.08.17.54.54; author rse; state Exp; branches; next 1.45; commitid x8N3mLVdQgkbdeAr; 1.45 date 2004.12.31.19.34.45; author rse; state Exp; branches; next 1.44; 1.44 date 2004.07.13.10.50.49; author rse; state Exp; branches; next 1.43; 1.43 date 2003.01.01.15.49.12; author rse; state Exp; branches; next 1.42; 1.42 date 2002.11.05.19.39.09; author rse; state Exp; branches; next 1.41; 1.41 date 2002.11.03.09.24.42; author rse; state Exp; branches; next 1.40; 1.40 date 2002.01.27.11.03.41; author rse; state Exp; branches; next 1.39; 1.39 date 2001.03.24.14.51.05; author rse; state Exp; branches; next 1.38; 1.38 date 2000.03.10.09.51.29; author rse; state Exp; branches; next 1.37; 1.37 date 2000.02.19.16.08.11; author rse; state Exp; branches; next 1.36; 1.36 date 2000.01.09.16.31.45; author rse; state Exp; branches; next 1.35; 1.35 date 99.12.30.21.59.02; author rse; state Exp; branches; next 1.34; 1.34 date 99.11.09.08.11.32; author rse; state Exp; branches; next 1.33; 1.33 date 99.11.01.10.27.21; author rse; state Exp; branches; next 1.32; 1.32 date 99.10.31.11.46.14; author rse; state Exp; branches 1.32.2.1; next 1.31; 1.31 date 99.10.26.15.08.03; author rse; state Exp; branches; next 1.30; 1.30 date 99.09.17.08.01.56; author rse; state Exp; branches; next 1.29; 1.29 date 99.08.17.08.08.36; author rse; state Exp; branches; next 1.28; 1.28 date 99.08.03.12.24.03; author rse; state Exp; branches; next 1.27; 1.27 date 99.07.22.15.39.12; author rse; state Exp; branches; next 1.26; 1.26 date 99.07.19.06.45.01; author rse; state Exp; branches; next 1.25; 1.25 date 99.07.10.14.21.18; author rse; state Exp; branches; next 1.24; 1.24 date 99.07.08.10.34.02; author rse; state Exp; branches; next 1.23; 1.23 date 99.07.08.10.19.12; author rse; state Exp; branches; next 1.22; 1.22 date 99.07.04.12.05.36; author rse; state Exp; branches; next 1.21; 1.21 date 99.06.27.15.38.04; author rse; state Exp; branches; next 1.20; 1.20 date 99.06.26.12.30.55; author rse; state Exp; branches; next 1.19; 1.19 date 99.06.25.15.14.35; author rse; state Exp; branches; next 1.18; 1.18 date 99.06.24.10.54.29; author rse; state Exp; branches; next 1.17; 1.17 date 99.06.20.09.52.02; author rse; state Exp; branches; next 1.16; 1.16 date 99.06.01.14.36.33; author rse; state Exp; branches; next 1.15; 1.15 date 99.06.01.09.55.27; author rse; state Exp; branches; next 1.14; 1.14 date 99.05.31.12.43.00; author rse; state Exp; branches; next 1.13; 1.13 date 99.05.30.13.08.37; author rse; state Exp; branches; next 1.12; 1.12 date 99.05.30.09.49.37; author rse; state Exp; branches; next 1.11; 1.11 date 99.05.25.14.35.02; author rse; state Exp; branches; next 1.10; 1.10 date 99.05.24.13.08.34; author rse; state Exp; branches; next 1.9; 1.9 date 99.05.24.11.45.15; author rse; state Exp; branches; next 1.8; 1.8 date 99.05.24.10.07.45; author rse; state Exp; branches; next 1.7; 1.7 date 99.05.24.07.58.14; author rse; state Exp; branches; next 1.6; 1.6 date 99.05.23.14.32.54; author rse; state Exp; branches; next 1.5; 1.5 date 99.05.22.14.37.53; author rse; state Exp; branches; next 1.4; 1.4 date 99.05.22.12.46.52; author rse; state Exp; branches; next 1.3; 1.3 date 99.05.22.12.28.30; author rse; state Exp; branches; next 1.2; 1.2 date 99.05.21.15.22.32; author rse; state Exp; branches; next 1.1; 1.1 date 99.05.21.09.44.10; author rse; state Exp; branches; next ; 1.32.2.1 date 99.11.01.10.25.03; author rse; state Exp; branches; next 1.32.2.2; 1.32.2.2 date 2000.02.04.22.07.18; author rse; state Exp; branches; next ; desc @@ 1.47 log @Adjusted all copyright messages for new year 2007. @ text @/* ** GNU Pth - The GNU Portable Threads ** Copyright (c) 1999-2007 Ralf S. Engelschall ** ** This file is part of GNU Pth, a non-preemptive thread scheduling ** library which can be found at http://www.gnu.org/software/pth/. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 ** USA, or contact Ralf S. Engelschall . ** ** test_mp.c: Pth test program (message port handling) */ /* ``Failure is not an option. It comes bundled with software.'' */ #include #include #include #include #include #include "pth.h" #include "test_common.h" /* our simple query structure */ struct query { pth_message_t head; /* the standard message header */ char *string; /* the query ingredients */ }; /* our worker thread which translates the string to upper case */ typedef struct { pth_msgport_t mp; pth_event_t ev; } worker_cleanup_t; static void worker_cleanup(void *arg) { worker_cleanup_t *wc = (worker_cleanup_t *)arg; pth_event_free(wc->ev, PTH_FREE_THIS); pth_msgport_destroy(wc->mp); return; } static void *worker(void *_dummy) { worker_cleanup_t wc; pth_msgport_t mp; pth_event_t ev; struct query *q; int i; fprintf(stderr, "worker: start\n"); wc.mp = mp = pth_msgport_create("worker"); wc.ev = ev = pth_event(PTH_EVENT_MSG, mp); pth_cleanup_push(worker_cleanup, &wc); for (;;) { if ((i = pth_wait(ev)) != 1) continue; while ((q = (struct query *)pth_msgport_get(mp)) != NULL) { fprintf(stderr, "worker: recv query <%s>\n", q->string); for (i = 0; q->string[i] != NUL; i++) q->string[i] = toupper(q->string[i]); fprintf(stderr, "worker: send reply <%s>\n", q->string); pth_msgport_reply((pth_message_t *)q); } } return NULL; } /* a useless ticker thread */ static void *ticker(void *_arg) { time_t now; fprintf(stderr, "ticker: start\n"); for (;;) { pth_sleep(5); now = time(NULL); fprintf(stderr, "ticker was woken up on %s", ctime(&now)); } /* NOTREACHED */ return NULL; } #define MAXLINELEN 1024 int main(int argc, char *argv[]) { char caLine[MAXLINELEN]; pth_event_t ev = NULL; pth_event_t evt = NULL; pth_t t_worker = NULL; pth_t t_ticker = NULL; pth_attr_t t_attr; pth_msgport_t mp = NULL; pth_msgport_t mp_worker = NULL; struct query *q = NULL; int n; if (!pth_init()) { perror("pth_init"); exit(1); } fprintf(stderr, "This is TEST_MP, a Pth test using message ports.\n"); fprintf(stderr, "\n"); fprintf(stderr, "Lines on stdin are send to a worker thread via message\n"); fprintf(stderr, "ports, translated to upper case by the worker thread and\n"); fprintf(stderr, "send back to the main thread via message ports.\n"); fprintf(stderr, "Additionally a useless ticker thread awakens every 5s.\n"); fprintf(stderr, "Enter \"quit\" on stdin for stopping this test.\n"); fprintf(stderr, "\n"); t_attr = pth_attr_new(); pth_attr_set(t_attr, PTH_ATTR_NAME, "worker"); pth_attr_set(t_attr, PTH_ATTR_JOINABLE, TRUE); pth_attr_set(t_attr, PTH_ATTR_STACK_SIZE, 16*1024); t_worker = pth_spawn(t_attr, worker, NULL); pth_attr_set(t_attr, PTH_ATTR_NAME, "ticker"); t_ticker = pth_spawn(t_attr, ticker, NULL); pth_attr_destroy(t_attr); pth_yield(NULL); mp_worker = pth_msgport_find("worker"); mp = pth_msgport_create("main"); q = (struct query *)malloc(sizeof(struct query)); ev = pth_event(PTH_EVENT_MSG, mp); evt = NULL; for (;;) { if (evt == NULL) evt = pth_event(PTH_EVENT_TIME, pth_timeout(20,0)); else evt = pth_event(PTH_EVENT_TIME|PTH_MODE_REUSE, evt, pth_timeout(20,0)); n = pth_readline_ev(STDIN_FILENO, caLine, MAXLINELEN, evt); if (n == -1 && pth_event_status(evt) == PTH_STATUS_OCCURRED) { fprintf(stderr, "main: Hey, what are you waiting for? Type in something!\n"); continue; } if (n < 0) { fprintf(stderr, "main: I/O read error on stdin\n"); break; } if (n == 0) { fprintf(stderr, "main: EOF on stdin\n"); break; } caLine[n-1] = NUL; if (strcmp(caLine, "quit") == 0) { fprintf(stderr, "main: quit\n"); break; } fprintf(stderr, "main: out --> <%s>\n", caLine); q->string = caLine; q->head.m_replyport = mp; pth_msgport_put(mp_worker, (pth_message_t *)q); pth_wait(ev); q = (struct query *)pth_msgport_get(mp); fprintf(stderr, "main: in <-- <%s>\n", q->string); } free(q); pth_event_free(ev, PTH_FREE_THIS); pth_event_free(evt, PTH_FREE_THIS); pth_msgport_destroy(mp); pth_cancel(t_worker); pth_join(t_worker, NULL); pth_cancel(t_ticker); pth_join(t_ticker, NULL); pth_kill(); return 0; } @ 1.46 log @Adjusted all copyright messages for new year 2006 @ text @d3 1 a3 1 ** Copyright (c) 1999-2006 Ralf S. Engelschall @ 1.45 log @Adjusted all copyright messages for new year 2005. @ text @d3 1 a3 1 ** Copyright (c) 1999-2005 Ralf S. Engelschall @ 1.44 log @Adjusted all copyright messages for new year 2004. @ text @d3 1 a3 1 ** Copyright (c) 1999-2004 Ralf S. Engelschall @ 1.43 log @Adjusted all copyright messages for new year 2003. @ text @d3 1 a3 1 ** Copyright (c) 1999-2003 Ralf S. Engelschall @ 1.42 log @1. The function "int pth_event_occurred(pth_event_t)" was replaced with "pth_status_t pth_event_status(pth_event_t)" where pth_status_t can have values of PTH_STATUS_PENDING (replacing the old FALSE return value of pth_event_occurred), PTH_STATUS_OCCURRED (replacing the old TRUE return value of pth_event_occurred), and PTH_STATUS_FAILED (a new return value indicating an error in processing the event). This was scheduler/event-manager errors can be indicated which happended while processing the event. For backward compatibility reasons, a macro pth_event_occurred() was added. This will be removed soon. 2. Use the new PTH_STATUS_FAILED event status in the scheduler's event-manager for filedescriptor events if the internal select(2) call returned with an error. Additionally this PTH_STATUS_FAILED is recognized by the high-level API functions (pth_select, etc) and produce the necessary POSIX conforming return codes (usually -1 and errno == EBADF). Parts submitted by: Thanh Luu @ text @d3 1 a3 1 ** Copyright (c) 1999-2002 Ralf S. Engelschall @ 1.41 log @add a bunch of cookies @ text @d146 1 a146 1 if (n == -1 && pth_event_occurred(evt)) { @ 1.40 log @bump copyright year @ text @d25 2 a26 1 @ 1.39 log @*** empty log message *** @ text @d3 1 a3 1 ** Copyright (c) 1999-2001 Ralf S. Engelschall @ 1.38 log @*** empty log message *** @ text @d3 1 a3 1 ** Copyright (c) 1999-2000 Ralf S. Engelschall @ 1.37 log @*** empty log message *** @ text @d101 2 a102 2 pth_t t_worker; pth_t t_ticker; d106 1 a106 1 struct query *q; @ 1.36 log @*** empty log message *** @ text @d90 1 a90 1 /* NOT REACHED */ @ 1.35 log @*** empty log message *** @ text @d43 11 d56 1 d63 3 a65 2 mp = pth_msgport_create("worker"); ev = pth_event(PTH_EVENT_MSG, mp); a76 2 pth_event_free(ev, PTH_FREE_ALL); pth_msgport_destroy(mp); d125 1 a125 1 pth_attr_set(t_attr, PTH_ATTR_JOINABLE, FALSE); d171 1 d175 4 @ 1.34 log @*** empty log message *** @ text @d3 1 a3 1 ** Copyright (c) 1999 Ralf S. Engelschall @ 1.33 log @*** empty log message *** @ text @d85 1 a85 1 int main(int argc, char *argv[]) d121 1 a121 1 d126 1 a126 1 @ 1.32 log @*** empty log message *** @ text @d2 1 a2 2 ** test_mp.c -- Pth test program (message port handling) ** d22 2 @ 1.32.2.1 log @*** empty log message *** @ text @d2 2 a3 1 ** GNU Pth - The GNU Portable Threads a22 2 ** ** test_mp.c: Pth test program (message port handling) @ 1.32.2.2 log @*** empty log message *** @ text @a42 11 typedef struct { pth_msgport_t mp; pth_event_t ev; } worker_cleanup_t; static void worker_cleanup(void *arg) { worker_cleanup_t *wc = (worker_cleanup_t *)arg; pth_event_free(wc->ev, PTH_FREE_THIS); pth_msgport_destroy(wc->mp); return; } a44 1 worker_cleanup_t wc; d51 2 a52 3 wc.mp = mp = pth_msgport_create("worker"); wc.ev = ev = pth_event(PTH_EVENT_MSG, mp); pth_cleanup_push(worker_cleanup, &wc); d64 2 d114 1 a114 1 pth_attr_set(t_attr, PTH_ATTR_JOINABLE, TRUE); a159 1 free(q); a162 4 pth_cancel(t_worker); pth_join(t_worker, NULL); pth_cancel(t_ticker); pth_join(t_ticker, NULL); @ 1.31 log @*** empty log message *** @ text @d12 1 a12 1 ** version 2 of the License, or (at your option) any later version. @ 1.30 log @*** empty log message *** @ text @d87 2 a88 2 pth_event_t ev; pth_event_t evt; d92 2 a93 2 pth_msgport_t mp; pth_msgport_t mp_worker; @ 1.29 log @*** empty log message *** @ text @d10 1 a10 1 ** modify it under the terms of the GNU Library General Public d17 1 a17 1 ** Library General Public License for more details. d19 1 a19 1 ** You should have received a copy of the GNU Library General Public @ 1.28 log @*** empty log message *** @ text @d123 1 a123 1 q = malloc(sizeof(struct query)); @ 1.27 log @*** empty log message *** @ text @a125 4 pth_nonblocking(STDIN_FILENO); pth_nonblocking(STDERR_FILENO); pth_nonblocking(STDOUT_FILENO); @ 1.26 log @*** empty log message *** @ text @d41 1 a41 1 /* out worker thread which translates the string to upper case */ @ 1.25 log @*** empty log message *** @ text @d33 2 @ 1.24 log @*** empty log message *** @ text @d95 5 a107 5 if (!pth_init()) { perror("pth_init"); exit(1); } @ 1.23 log @*** empty log message *** @ text @d2 1 a2 1 ** test_mp.c -- PTH test program (message port handling) d95 1 a95 1 fprintf(stderr, "This is TEST_MP, a PTH test using message ports.\n"); @ 1.22 log @*** empty log message *** @ text @d6 2 a7 2 ** This file is part of PTH, a non-preemptive thread scheduling library ** which can be found at http://www.gnu.org/software/pth/. @ 1.21 log @*** empty log message *** @ text @d7 1 a7 1 ** which can be found at http://www.engelschall.com/sw/pth/. @ 1.20 log @*** empty log message *** @ text @d109 8 a116 3 t_attr = pth_attr("worker", PTH_PRIO_STD, PTH_FLAG_NOJOIN, PTH_CANCEL_DEFAULT, 16*1024, NULL); t_worker = pth_spawn(&t_attr, worker, NULL); t_ticker = pth_spawn(&t_attr, ticker, NULL); @ 1.19 log @*** empty log message *** @ text @d116 1 a116 1 q = (struct query *)malloc(sizeof(struct query)); @ 1.18 log @*** empty log message *** @ text @d104 4 a107 1 pth_init(); @ 1.17 log @*** empty log message *** @ text @d109 1 a109 1 pth_yield(); @ 1.16 log @*** empty log message *** @ text @d106 1 a106 1 t_attr = pth_attr("worker", PTH_PRIO_STD, PTH_FLAG_NOJOIN, 16*1024, NULL); @ 1.15 log @*** empty log message *** @ text @d49 1 a49 1 ev = pth_event(PTH_EVENT_MSG|PTH_UNTIL_RECEIVED, mp); d55 1 a55 1 for (i = 0; q->string[i] != '\0'; i++) d114 1 a114 1 ev = pth_event(PTH_EVENT_MSG|PTH_UNTIL_RECEIVED, mp); d123 1 a123 1 evt = pth_event(PTH_EVENT_TIME|PTH_UNTIL_ELAPSED, pth_timeout(20,0)); d125 1 a125 1 evt = pth_event(PTH_EVENT_TIME|PTH_UNTIL_ELAPSED|PTH_MODE_REUSE, evt, pth_timeout(20,0)); d139 1 a139 1 caLine[n-1] = '\0'; @ 1.14 log @*** empty log message *** @ text @d20 1 a20 1 ** License along with this library; if not, write to the Free @ 1.13 log @*** empty log message *** @ text @d106 1 a106 1 t_attr = pth_attr("worker", PTH_PRIO_STD, PTH_FLAG_NOJOIN, 16*1024); @ 1.12 log @*** empty log message *** @ text @d51 1 a51 1 if ((i = pth_wait(&ev, NULL)) != 1) a114 1 evt = pth_event(PTH_EVENT_TIME|PTH_UNTIL_ELAPSED, pth_time(5,0)); d120 1 d122 4 d127 2 a128 2 if (pth_event_occurred(evt)) { fprintf(stderr, "main: stdin: hey, what are you waiting for?!\n"); d132 1 a132 1 fprintf(stderr, "main: stdin: read error\n"); d136 1 a136 1 fprintf(stderr, "main: stdin: EOF\n"); d148 1 a148 1 pth_wait(&ev, NULL); @ 1.11 log @*** empty log message *** @ text @d86 1 d115 1 d122 5 a126 1 n = pth_readline(STDIN_FILENO, caLine, MAXLINELEN); d149 3 @ 1.10 log @*** empty log message *** @ text @d105 1 a105 1 t_attr = pth_attr("worker", PTH_PRIO_STD, PTH_FLAG_NONE, 16*1024); @ 1.9 log @*** empty log message *** @ text @d130 1 a130 1 if (strcasecmp(caLine, "quit") == 0) { @ 1.8 log @*** empty log message *** @ text @d63 1 a63 1 pth_exit(NULL); d71 1 a71 1 while (1) { d76 2 @ 1.7 log @*** empty log message *** @ text @d103 1 a103 1 t_attr = pth_attr("worker", 0, 0, 16*1024, TRUE); @ 1.6 log @*** empty log message *** @ text @d6 1 a6 1 ** This file is part of PTH, a non-preemtive thread scheduling library @ 1.5 log @*** empty log message *** @ text @d72 1 a72 1 pth_sleep(10); d91 9 @ 1.4 log @*** empty log message *** @ text @d2 21 a22 2 ** test_mp - just a little PTH testing application for message port usage ** Copyright (c) 1999 Ralf S. Engelschall, All Rights Reserved. @ 1.3 log @*** empty log message *** @ text @d32 1 a32 3 fprintf(stderr, "worker: loop (%d)\n", pth_msgport_pending(mp)); if ((i = pth_wait(&ev, NULL)) != 1) { fprintf(stderr, "worker: i=%d??\n", i); a33 2 } fprintf(stderr, "worker: next (%d)\n", pth_msgport_pending(mp)); @ 1.2 log @*** empty log message *** @ text @d96 1 a96 1 fprintf(stderr, "main: stdin: read error"); d100 1 a100 1 fprintf(stderr, "main: stdin: EOF"); d105 1 a105 1 fprintf(stderr, "main: quit"); @ 1.1 log @*** empty log message *** @ text @d32 1 a32 1 fprintf(stderr, "worker: loop (%d)\n", pth_message_pending(mp)); d37 2 a38 2 fprintf(stderr, "worker: next (%d)\n", pth_message_pending(mp)); while ((q = (struct query *)pth_message_get(mp)) != NULL) { d43 1 a43 1 pth_message_reply((pth_message_t *)q); d111 1 a111 1 pth_message_put(mp_worker, (pth_message_t *)q); d113 1 a113 1 q = (struct query *)pth_message_get(mp); @