Click or drag to resize
CfxThread Class

[This is preliminary documentation and is subject to change.]

A simple thread abstraction that establishes a message loop on a new thread. The consumer uses CfxTaskRunner to execute code on the thread's message loop. The thread is terminated when the CfxThread object is destroyed or stop() is called. All pending tasks queued on the thread's message loop will run to completion before the thread is terminated. cef_thread_create() can be called on any valid CEF thread in either the browser or render process. This structure should only be used for tasks that require a dedicated thread. In most cases you can post tasks to an existing CEF thread instead of creating a new one; see cef_task.h for details.
Inheritance Hierarchy
SystemObject
  ChromiumCfxObject
    ChromiumCfxBase
      ChromiumCfxLibraryBase
        ChromiumCfxThread

Namespace: Chromium
Assembly: ChromiumFX (in ChromiumFX.dll)
Syntax
public class CfxThread : CfxLibraryBase

The CfxThread type exposes the following members.

Properties
  NameDescription
Public propertyIsRunning
Returns true (1) if the thread is currently running. This function must be called from the same thread that called cef_thread_create().
Public propertyNativePtr
Provides access to the underlying native cef struct. This is a refcounted library struct derived from cef_base_t. Add a ref in order to keep it alive when this managed object go out of scope.
(Inherited from CfxLibraryBase.)
Public propertyPlatformThreadId
Returns the platform thread ID. It will return the same value after stop() is called. This function is safe to call from any thread.
Public propertyTaskRunner
Returns the CfxTaskRunner that will execute code on this thread's message loop. This function is safe to call from any thread.
Top
Methods
  NameDescription
Public methodStatic memberCreate
Create and start a new thread. This function does not block waiting for the thread to run initialization. |displayName| is the name that will be used to identify the thread. |priority| is the thread execution priority. |messageLoopType| indicates the set of asynchronous events that the thread can process. If |stoppable| is true (1) the thread will stopped and joined on destruction or when stop() is called; otherwise, the the thread cannot be stopped and will be leaked on shutdown. On Windows the |comInitMode| value specifies how COM will be initialized for the thread. If |comInitMode| is set to COM_INIT_MODE_STA then |messageLoopType| must be set to ML_TYPE_UI.
Public methodStop
Stop and join the thread. This function must be called from the same thread that called cef_thread_create(). Do not call this function if cef_thread_create() was called with a |stoppable| value of false (0).
Top
Remarks
See also the original CEF documentation in cef/include/capi/cef_thread_capi.h.
See Also