Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::OSThreadIterator Class Reference

#include <os_thread.h>

Inheritance diagram for dart::OSThreadIterator:
dart::ValueObject

Public Member Functions

 OSThreadIterator ()
 
 ~OSThreadIterator ()
 
bool HasNext () const
 
OSThreadNext ()
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Detailed Description

Definition at line 342 of file os_thread.h.

Constructor & Destructor Documentation

◆ OSThreadIterator()

dart::OSThreadIterator::OSThreadIterator ( )

Definition at line 330 of file os_thread.cc.

330 {
331 ASSERT(OSThread::thread_list_lock_ != nullptr);
332 // Lock the thread list while iterating.
333 OSThread::thread_list_lock_->Lock();
334 next_ = OSThread::thread_list_head_;
335}
#define ASSERT(E)

◆ ~OSThreadIterator()

dart::OSThreadIterator::~OSThreadIterator ( )

Definition at line 337 of file os_thread.cc.

337 {
338 ASSERT(OSThread::thread_list_lock_ != nullptr);
339 // Unlock the thread list when done.
340 OSThread::thread_list_lock_->Unlock();
341}

Member Function Documentation

◆ HasNext()

bool dart::OSThreadIterator::HasNext ( ) const

Definition at line 343 of file os_thread.cc.

343 {
344 ASSERT(OSThread::thread_list_lock_ != nullptr);
345 ASSERT(OSThread::thread_list_lock_->IsOwnedByCurrentThread());
346 return next_ != nullptr;
347}

◆ Next()

OSThread * dart::OSThreadIterator::Next ( )

Definition at line 349 of file os_thread.cc.

349 {
350 ASSERT(OSThread::thread_list_lock_ != nullptr);
351 ASSERT(OSThread::thread_list_lock_->IsOwnedByCurrentThread());
352 OSThread* current = next_;
353 next_ = next_->thread_list_next_;
354 return current;
355}

The documentation for this class was generated from the following files: