![]() |
![]() |
![]() |
Anjuta Developers Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
AnjutaAsyncCommandAnjutaAsyncCommand — AnjutaCommand subclass that serves as the base for commands that need to run in another thread. |
#include <libanjuta/anjuta-async-command.h> struct AnjutaAsyncCommandClass; AnjutaAsyncCommandPriv; gchar * anjuta_async_command_get_error_message (AnjutaCommand *command
); void anjuta_async_command_lock (AnjutaAsyncCommand *self
); void anjuta_async_command_set_error_message (AnjutaCommand *command
,const gchar *error_message
); void anjuta_async_command_unlock (AnjutaAsyncCommand *self
);
AnjutaAsyncCommand provides a simple way for plugins to run tasks that are synchronous and usually take several seconds or longer to execute in another thread so that such tasks do no block Anjuta's user interface.
AnjutaAsyncCommand automatically runs and manages the thread when the command starts, and destroys it when the command finishes. Aside from locking protected data with anjuta_async_command_lock/unlock, clients, and even commands themselves need not even be concerned that their tasks are rnning on another thread.
For an example of how AnjutaAsyncCommand is used, see the Subversion plugin.
gchar * anjuta_async_command_get_error_message
(AnjutaCommand *command
);
|
AnjutaAsyncCommand object |
Returns : |
The error message the async command resulted in. The caller should free the string |
void anjuta_async_command_lock (AnjutaAsyncCommand *self
);
Locks the command's built-in mutex.
|
AnjutaAsyncCommand object. |
void anjuta_async_command_set_error_message (AnjutaCommand *command
,const gchar *error_message
);
Set the error message this async command resulted in
|
AnjutaAsyncCommand object |
|
The error message that should be used |