WSDisableLinkLock (C 函数)

void WSDisableLinkLock( WSLINK l )

对由 l 指定的 WSTP 连接禁用线程安全.

更多信息

  • WSTP 的标头文件 wstp.h 已对 WSDisableLinkLock() 作出声明.

范例

基本范例  (1)

#include "wstp.h"

int main(int argc, char **argv)
{
    WSEnvironmentParameter ep;
    WSENV env;
    WSLINK link, loopbackLink;
    int error;
    
    ep = WSNewParameters(WSREVISION, WSAPIREVISION);
    if(ep == (WSEnvironmentParameter)0)
    { /* Unable to create new parameters object */ }

    WSSetThreadSafeLinksParameter(ep);

    env = WSInitialize(ep);
    if(env == (WSENV)0)
    { /* Unable to create new environment object */ }

    WSReleaseParameters(ep);

    link = WSOpenArgcArgv(env, argc, argv, &error);
    if(link == (WSLINK)0 || error != WSEOK)
    { /* Cannot create link */ }

    WSActivate(link);

    loopbackLink = WSLoopbackOpen(env, &error);
    if(loopbackLink == (MENV)0 || error != WSEOK)
    { /* Unable to create loopback link */ }

    WSDisableLinkLock(loopbackLink);

    /* ... */

    WSClose(loopbackLink);
    WSClose(link);

    WSDeinitialize(env);

    return 0;
}