X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcclient%2FREADME;h=a1a73f51e3e48dbb0ea91771d69c4c82dc09d0b7;hb=c93d979c288b14b8ad95dc49eecf3016ba9eb22d;hp=f2755c3149558f7195195aacc653fd868e17f9df;hpb=04ac803952a6926e959aadd66d6dda911831e120;p=silc.git diff --git a/lib/silcclient/README b/lib/silcclient/README index f2755c31..a1a73f51 100644 --- a/lib/silcclient/README +++ b/lib/silcclient/README @@ -82,19 +82,21 @@ Finishing threads when closing connection When closing SilcClientConnection all threads must first be finished before the connection machine is finished. This is done by finishing all running command threads. That will also finish all waiting packet - threads as they are always waiting for a command. If any thread is - waiting for something else than a command (such as event threads) they - must be explicitly finished. The threads are finished by continuing - them synchronously. The threads will detect that we are disconnected - (see below). SILC_FSM_YIELD must be returned in st_close() as that - gives the FSM scheduler time to finish the threads first. After that - the machine can be finished. + and notify threads as they are always waiting for a command. If any + thread is waiting for something else than a command (such as event + threads) they must be explicitly finished. The threads are finished by + continuing them synchronously. The threads will detect that we are + disconnected (see below). SILC_FSM_YIELD must be returned in + st_close() as that gives the FSM scheduler time to finish the threads + first. After that the machine can be finished. Also, any thread that runs in SilcClientConnection machine must always after returning from wait state to check if we are disconnected by doing - if (conn->internal->disconnected) + if (conn->internal->disconnected) { xxx; + return SILC_FSM_FINISH; + } If disconnected the thread must finish immediately by returning SILC_FSM_FINISH.