Branch: Tag:

2015-08-20

2015-08-20 08:15:47 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Thread.Thread [Documentation]: Adjusted return type of thread function.

The return value of the thread function is relevant (as it is returned
by wait())...

Fixes [LysLysKOM 21410113] reported by Per Cederqvist. Thanks.

Also adjusted the declared type of create() somewhat so that it requires
a thread function (ie the compiler will now complain if it is called
without arguments).

1892:   /*! @class Thread    */    - /*! @decl void create(function(mixed...:void) f, mixed ... args) + /*! @decl void create(function(mixed...:mixed|void) f, mixed ... args)    *!    *! This function creates a new thread which will run simultaneously    *! to the rest of the program. The new thread will call the function
3360:    PIKE_MAP_VARIABLE("result", OFFSETOF(thread_state, result),    tMix, T_MIXED, 0);    ADD_FUNCTION("create",f_thread_create, -  tFuncV(tNone,tMixed,tVoid), +  tFuncV(tMixed,tMixed,tVoid),    ID_PROTECTED);    ADD_FUNCTION("backtrace",f_thread_backtrace,tFunc(tNone,tArray),0);    ADD_FUNCTION("wait",f_thread_id_result,tFunc(tNone,tMix),0);