• The calls act as a warning to other threads to go to sleep and wait their turn for the mutex lock.

    两个函数调用作用就是警告其它线程它们继续睡眠等待轮到它们对互斥对象加锁。

    youdao

  • While still holding the mutex lock, our thread will call pthread_cond_wait(&mycond,&mymutex).

    锁定互斥对象线程调用 pthread_cond_wait(&mycond,&mymutex)。

    youdao

  • If thread "a" tries to lock a mutex while thread "b" has the same mutex locked, thread "a" goes to sleep.

    如果线程a试图锁定互斥对象,而此时线程b已锁定同一个互斥对象时,线程a就将进入睡眠状态。

    youdao

  • 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.

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

    youdao

  • This function gets a pointer to the mutex it is trying to lock.

    这个函数会获得一个指向正在尝试锁定互斥指针

    youdao

  • Your code could repeatedly lock and unlock the mutex, checking for any changes to the value.

    代码可以反复互斥对象锁定和解锁,以检查任何变化

    youdao

  • Otherwise, you can use the "recursive" mutex type, which allows the holder of the lock to lock the same mutex multiple times.

    另外还可以使用递归类型互斥量,这种互斥量允许同一个互斥量锁定多次

    youdao

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

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

    youdao

  • Because you're sharing the same mutex for push and pop operations, the data-read speed is somewhat compromised as writer threads access the lock.

    因为添加取出数据操作使用相同互斥锁,所以读取数据速度会影响数据的线程访问

    youdao

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

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

    youdao

  • This call is handy when you want to lock a mutex while your thread is doing something else (because the mutex is currently locked).

    线程正在其它事情的时候(由于互斥对象当前锁定的),如果希望锁定互斥对象,这个调用相当方便。

    youdao

  • Main thread: Lock mutex and increment threadcount.

    主线程:锁定互斥量增量threadcount

    youdao

  • To help minimize mutex allocation and locking time, the JVM manages a global lock cache and a per-thread lock cache where each cache contains unallocated pthread_mutexes.

    为了帮助实现互斥锁分配锁定时间最小化JVM管理全局缓存和一个单线程锁缓存,其中每个缓存包含了未分配的 pthread_mutex

    youdao

  • The first function, mutex_trylock, is used in situations where you want the lock immediately or you want control to be returned to you if the mutex is not available.

    需要立即锁定以及希望互斥锁不可用时掌握控制情形下可以使用第一个函数mutex _ trylock。

    youdao

  • And you should never unlock a mutex that you don't hold a lock for (otherwise, the pthread_mutex_unlock call will fail with a non-zero EPERM return value).

    并且绝对不要对保持的互斥对象进行解锁操作(否则,pthread _ mutex_unlock调用失败并带一个非零的eperm返回值)。

    youdao

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

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

    youdao

  • If the mutex is currently unlocked you'll get the lock, and this function will return zero.

    如果互斥对象当前处于解锁状态,那么获得并且函数返回

    youdao

  • As you may have guessed, the POSIX threads library will grant a lock without having put the thread to sleep at all if a thread tries to lock an unlocked mutex.

    可以推测到,当线程试图锁定一个未加的互斥对象时,POSI x线程同意锁定,不会使线程进入睡眠状态。

    youdao

  • Finally, the first thing any thread tries to do when waking up from pthread_cond_wait is re-lock the mutex it unlocked when initially called.

    最后一个线程调用pthread_cond_wait而被唤醒第一件事就是重新锁定最初调用时解锁那个互斥量。

    youdao

  • Likewise, if thread "c" tries to lock the mutex while thread "a" is holding it, thread "c" will also be put to sleep temporarily.

    同样地线程a锁定互斥对象时,如果线程c试图锁定互斥对象的话,线程c临时进入睡眠状态。

    youdao

  • Pthread_mutex_lock accepts a single pointer to a mutex to lock.

    pthread _ mutex_lock接受一个指向互斥对象指针作为参数以将其锁定。

    youdao

  • Buffer acquisition is managed through the use of latches, known as mutex, and lock-access information.

    缓冲区获取通过使用存器(latch)锁访问信息管理的,该锁存器称作 mutex

    youdao

  • A thread attempting to re lock this mutex without first unlocking it shall return with an error.

    如果线程首先解除锁定互斥锁的情况下尝试重新锁定互斥锁,则返回错误

    youdao

  • A thread attempting to re lock this mutex without first unlocking it shall deadlock.

    如果线程在首先解除互斥的情况下尝试重新锁定该互斥锁,则会产生死锁。

    youdao

  • This could happen, for instance, if atomic CPU instruction is used to implement a mutex (as in "lock-free" algorithms).

    可能发生例如如果原子cpu指令用来实现互斥(无锁定算法)。

    youdao

  • This could happen, for instance, if atomic CPU instruction is used to implement a mutex (as in "lock-free" algorithms).

    可能发生例如如果原子cpu指令用来实现互斥(无锁定算法)。

    youdao

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

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

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