zoukankan      html  css  js  c++  java
  • Once a detached thread has terminated, its resources, including the thread ID, may be reused

    pthread_detach() — mark a thread as detached to reclaim its resources when it terminates

    SYNOPSIS

    #include <pthread.h>

    int pthread_detach( pthread_t thread );

    PARAMETERS

    thread

    Thread whose resources are to be reclaimed immediately when it terminates.

    DESCRIPTION

    pthread_detach() is used to detach the thread thread. When thread terminates, its resources will automatically be reclaimed by the system. If thread has already terminated, pthread_detach() causes the resources of thread to be reclaimed by the system.

    pthread_detach() does not cause thread to terminate.

    Once a detached thread has terminated, its resources, including the thread ID, may be reused by the system. The return status of a detached thread is lost when the thread terminates.

    Calling this function multiple times for the same thread results in undefined behavior.

    RETURN VALUE

    Upon successful completion, pthread_detach() returns zero. Otherwise, an error number is returned to indicate the error (the errno variable is not set).

    ERRORS

    If any of the following occur, the pthread_detach() function returns the corresponding error number:

    [EINVAL]

    thread does not refer to a joinable thread.

    [ESRCH]

    No thread could be found corresponding to thread.

    AUTHOR

    pthread_detach() was derived from the IEEE POSIX P1003.1c standard.

  • 相关阅读:
    zabbix执行远程命令
    zabbix监控主从同步
    s3fs+minio模拟挂载S3服务器到本地服务器
    PHP编译报错
    ldd可执行程序时返回not a dynamic executable
    Windows nessus安装
    Django数据库,在原有表中添加新字段
    docker安装fastdfs与java客户端测试
    Docker安装与启动
    2018HBCPC
  • 原文地址:https://www.cnblogs.com/cy163/p/1269922.html
Copyright © 2011-2022 走看看