## EOperationPool

EOperationPool

## Synopsis

                        EOperationPool;
    EOperationPool *    e_operation_pool_new                (guint max_threads,
                                                             GFunc thread_func,
                                                             gpointer user_data);
    void                e_operation_pool_free               (EOperationPool *pool);
    guint32             e_operation_pool_reserve_opid       (EOperationPool *pool);
    void                e_operation_pool_release_opid       (EOperationPool *pool,
                                                             guint32 opid);
    void                e_operation_pool_push               (EOperationPool *pool,
                                                             gpointer opdata);

## Description

## Details

### EOperationPool

    typedef struct _EOperationPool EOperationPool;

Contains only private data that should be read and manipulated using the functions below.

Since 3.2

### e_operation_pool_new ()

    EOperationPool *    e_operation_pool_new                (guint max_threads,
                                                             GFunc thread_func,
                                                             gpointer user_data);

FIXME: Document me.

`max_threads` : | Maximum number of threads for this pool
`thread_func` : | Function to run for a given thread
`user_data` : | The user data to pass to `thread_func`

Since 3.2

### e_operation_pool_free ()

    void                e_operation_pool_free               (EOperationPool *pool);

FIXME: Document me.

Since 3.2

### e_operation_pool_reserve_opid ()

    guint32             e_operation_pool_reserve_opid       (EOperationPool *pool);

Reserves new operation ID, which is returned. This operation ID may be released by `e_operation_pool_release_opid()` when the operation is finished.

`pool` : | an EOperationPool
Returns : | a new operation ID

Since 3.2

### e_operation_pool_release_opid ()

    void                e_operation_pool_release_opid       (EOperationPool *pool,
                                                             guint32 opid);

Releases `opid` previously reserved by `e_operation_pool_reserve_opid()`.

`pool` : | an EOperationPool
`opid` : | an operation ID

Since 3.2

### e_operation_pool_push ()

    void                e_operation_pool_push               (EOperationPool *pool,
                                                             gpointer opdata);

Pushes an operation to be processed. `opdata` is passed to the function provided in `e_operation_pool_new()`.

`pool` : | an EOperationPool
`opdata` : | user data for the operation

Since 3.2