全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Condition variable?

Definition 15.11 University Computer Science — Year 2 · 第 15 章 — Threads and Synchronisation

A condition variable lets a thread holding a lock wait for a condition on the data the lock protects. pthread_cond_wait(&c, &m) releases m and puts the thread to sleep, in one step; when another thread calls pthread_cond_signal(&c) (wake one waiter) or pthread_cond_broadcast(&c) (wake all), the sleeper wakes and takes m again before returning.

在原文中阅读 →