diff options
author | isiora <none@example.com> | 2018-03-16 18:31:51 +0000 |
---|---|---|
committer | isiora <none@example.com> | 2018-03-16 18:31:51 +0000 |
commit | 70eecc1bafc85f7d589f913e00be1736821b4a15 (patch) | |
tree | a2436cda1838e01260805a89a2bfa7d219656e27 /demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-SEC/proxies/tssockstub.c | |
parent | 259f9cace1827a20d76c93a909b57e847d2ff9a0 (diff) | |
download | ChibiOS-70eecc1bafc85f7d589f913e00be1736821b4a15.tar.gz ChibiOS-70eecc1bafc85f7d589f913e00be1736821b4a15.tar.bz2 ChibiOS-70eecc1bafc85f7d589f913e00be1736821b4a15.zip |
Added multithread tcp client example.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11783 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-SEC/proxies/tssockstub.c')
-rw-r--r-- | demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-SEC/proxies/tssockstub.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-SEC/proxies/tssockstub.c b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-SEC/proxies/tssockstub.c index 21cc9d28c..f456ee62a 100644 --- a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-SEC/proxies/tssockstub.c +++ b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-SEC/proxies/tssockstub.c @@ -68,6 +68,7 @@ typedef struct stub_op { static objects_fifo_t ops_fifo;
static msg_t ops_msgs[STUB_MAX_OPS];
static struct stub_op ops[STUB_MAX_OPS] = {0};
+static bool tsSkelIsReady = false;
/*===========================================================================*/
/* Module local functions. */
@@ -149,6 +150,9 @@ THD_FUNCTION(TsStubsService, tsstate) { }
switch (skrp->req) {
+ case SKEL_REQ_READY:
+ tsSkelIsReady = true;
+ break;
case SKEL_REQ_GETOP:
/* The nsec skeleton calls us to get a new op ready to be executed.*/
@@ -245,6 +249,12 @@ THD_FUNCTION(TsStubsService, tsstate) { }
}
+void tsWaitStubSkelReady(void) {
+ while (!tsSkelIsReady) {
+ chThdSleepMilliseconds(100);
+ }
+}
+
int socket(int domain, int type, int protocol) {
stub_op_t *op = getNewOp();
op->op_code = STUB_OP_SOCKET;
|