Macro in ldk_jobs.h

LDK_JOBS_DEFAULT_WORKER_COUNT

#define LDK_JOBS_DEFAULT_WORKER_COUNT 4u
Struct in ldk_jobs.h

LDKJobs

typedef struct LDKJobs{
  void *internal;
  bool is_initialized;
}LDKJobs;
Struct in ldk_jobs.h

LDKAsyncResultState

typedef struct LDKAsyncResultState LDKAsyncResultState;
Typedef in ldk_jobs.h

LDKJobFunc

Callback executed as a job by the work scheduler.

typedef bool(*LDKJobFunc)(void *user_data);

Parameters

user_data
Opaque data forwarded to the callback or job.

Returns

True if the operation succeeds; false otherwise.

Enum in ldk_jobs.h

LDKAsyncStatus

typedef enum LDKAsyncStatus{
  LDK_ASYNC_STATUS_INVALID=0,
  LDK_ASYNC_STATUS_PENDING,
  LDK_ASYNC_STATUS_RUNNING,
  LDK_ASYNC_STATUS_SUCCEEDED,
  LDK_ASYNC_STATUS_FAILED,
}LDKAsyncStatus;
Function in ldk_jobs.h

ldk_jobs_initialize

Initialize the jobs.

LDK_API bool ldk_jobs_initialize(
 LDKJobs *jobs,
 u32 worker_count
);

Parameters

LDKJobs *jobs
Jobs used by this operation.
u32 worker_count
Number of worker threads configured for the job pool.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_jobs.h

ldk_jobs_terminate

Shut down the jobs.

LDK_API void ldk_jobs_terminate(LDKJobs *jobs);

Parameters

LDKJobs *jobs
Jobs used by this operation.
Function in ldk_jobs.h

ldk_jobs_terminate_with_diagnostics

Shut down the job system and collect termination diagnostics.

LDK_API void ldk_jobs_terminate_with_diagnostics(
 LDKJobs *jobs,
 XThreadPoolShutdownCallback callback,
 void *user_data
);

Parameters

LDKJobs *jobs
Jobs used by this operation.
XThreadPoolShutdownCallback callback
Callback invoked by this operation.
void *user_data
Opaque data forwarded to the callback or job.
Function in ldk_jobs.h

ldk_jobs_submit

Submit work to the job pool and obtain an asynchronous result.

LDK_API LDKAsyncResult ldk_jobs_submit(
 LDKJobs *jobs,
 LDKJobFunc function,
 void *user_data
);

Parameters

LDKJobs *jobs
Jobs used by this operation.
LDKJobFunc function
Function to run as a scheduled job.
void *user_data
Opaque data forwarded to the callback or job.

Returns

Asynchronous result for tracking job completion.

Function in ldk_jobs.h

ldk_async_result_is_valid

Check whether the async result is valid.

LDK_API bool ldk_async_result_is_valid(LDKAsyncResult result);

Parameters

LDKAsyncResult result
Optional result structure populated with error details.

Returns

True when the queried condition holds; false otherwise.

Function in ldk_jobs.h

ldk_async_result_is_done

Check whether an asynchronous job has completed.

LDK_API bool ldk_async_result_is_done(LDKAsyncResult result);

Parameters

LDKAsyncResult result
Optional result structure populated with error details.

Returns

True when the queried condition holds; false otherwise.

Function in ldk_jobs.h

ldk_async_result_wait

Wait for an asynchronous job to complete.

LDK_API bool ldk_async_result_wait(LDKAsyncResult result);

Parameters

LDKAsyncResult result
Optional result structure populated with error details.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_jobs.h

ldk_async_result_release

Release resources associated with an asynchronous result.

LDK_API void ldk_async_result_release(LDKAsyncResult *result);

Parameters

LDKAsyncResult *result
Optional result structure populated with error details.