• 只能任务持有互斥并且只有这个任务可以互斥锁

    Only one task may hold the mutex at a time, and only this task can unlock the mutex.

    youdao

  • 基于互斥方法问题

    The problem with a mutex-based approach.

    youdao

  • 将创建一个新的互斥锁初始化结构

    This creates a new mutex and initializes the structure.

    youdao

  • 互斥简单但是一些规则必须牢记

    The mutex is simple, but there are some rules you should remember.

    youdao

  • 还要注意两个条件变量使用相同互斥锁

    Also note that both condition variables use the same mutex.

    youdao

  • 一个互斥锁定后必须

    After a mutex is locked, it must be unlocked.

    youdao

  • 内核可以使用互斥锁实现信号量行为

    Mutexes are available in the kernel as a way to accomplish semaphore behavior.

    youdao

  • 操作设置涉及分配预先互斥锁

    The setup for a lock operation involves allocation of a prelocked mutex.

    youdao

  • 可能因为分配时间片结束持有互斥锁线程取消调度。

    A thread holding a mutex can be de-scheduled, perhaps because it was the end of its time-slice.

    youdao

  • 无论哪种情形中控制返回时调用将持有互斥

    In either case, when control is returned, the caller holds the mutex.

    youdao

  • 因此最后两个线程等待条件变量互斥锁没有住。

    Therefore, at the end of it all, you now have two reader threads, both waiting on the condition variable, and the mutex is unlocked.

    youdao

  • 比如多线程个线程可以一个互斥锁句柄

    For example, multiple threads can each have a handle to a mutex object.

    youdao

  • 队列构造函数析构函数负责创建销毁互斥锁清单1

    The constructor and destructor of the queue class are responsible for the creation and destruction of the mutex, as shown in Listing 1.

    youdao

  • 如果可用,则获取执行互斥动作然后释放

    When the lock is available, it is taken, the mutually-exclusive action is performed, and then the lock is released.

    youdao

  • 如果在读线程能够获得互斥之前发生了超时,那么需要进行处理

    If the timeout has occurred before the reader thread could acquire the mutex, then no processing need be done.

    youdao

  • 非争用操作一个互斥锁返回线程缓存

    Uncontested unlock operations return a locked mutex to the thread lock cache.

    youdao

  • 内核互斥锁原子api之上实现对于内核用户可见的。

    The kernel mutex is implemented on top of the atomic API, though this is not visible to the kernel user.

    youdao

  • 如果互斥持有(),那么就返回1;否则,返回0

    If the mutex is held (locked), then one is returned; otherwise, zero.

    youdao

  • 对于等待同一互斥锁其他线程不利影响因为等待时间现在更长

    For other threads waiting on the same mutex, this has a negative effect, because the wait time is now even longer.

    youdao

  • 最后可以通过调用mutex_is_locked检查互斥锁状态

    Finally, you can check the status of a mutex through a call to mutex_is_locked.

    youdao

  • 如果超时时间段结束时还没有唤醒读线程需要唤醒自身释放互斥

    If not awake otherwise, at the end of the timeout, the reader needs to wake itself up and release the mutex.

    youdao

  • 可以通过DEFINE _ mutex使用一个操作创建初始化互斥

    You create and initialize a mutex in one operation through the DEFINE_MUTEX macro.

    youdao

  • 更好做法定义另一个方法它接收一系列整数获取释放互斥一次

    A far better approach would be to define another method that accepts a list of integers and acquire and release the mutex only once.

    youdao

  • 这个调用互斥可用返回否则互斥锁可用之前休眠

    This call returns if the mutex is available; otherwise, it sleeps until the mutex is available.

    youdao

  • 多个控制线程可以同时在队列添加数据删除数据,所以需要互斥锁对象管理同步

    Multiple threads of control can simultaneously try to push data to the queue or remove data, so you need a mutex object to manage the synchronization.

    youdao

  • 现在剩下次要任务 ——初始互斥锁启动线程运行可上传的文件列表

    This just leaves us with a couple of minor bookkeeping tasks -- initializing the mutex and starting a thread to run through the list of uploadable files.

    youdao

  • 存放数据时候先要获得互斥,再往总线数据,最后再释放互斥锁

    When publishing its data, it would acquire a mutex, do writes to the bus, and release the mutex.

    youdao

  • 这么会唤醒所有等待条件变量_ cond线程;读线程现在隐式地争夺互斥

    Doing so awakens all the reader threads that were waiting on the condition variable _cond; the reader threads now implicitly compete for the mutex lock as and when it is released.

    youdao

  • 显然数据放到队列像是把数据添加列表中必须使用互斥保护这个操作

    Clearly, pushing data into the queue is akin to appending data to the list, and this operation must be guarded by mutex locks.

    youdao

  • 两个级别上执行(清单7):读写各个节点包含一个互斥锁

    Locking occurs on two levels (see Listing 7) : The list has a read-write lock, while individual nodes contain a mutex.

    youdao

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定