## AnjutaAsyncCommand

AnjutaAsyncCommand — #AnjutaCommand subclass that serves as the base for commands that need to run in another thread.

## Synopsis

    #include <libanjuta/anjuta-async-command.h>

    #define             ANJUTA_TYPE_ASYNC_COMMAND
    #define             ANJUTA_ASYNC_COMMAND                (obj)
    #define             ANJUTA_ASYNC_COMMAND_CLASS          (klass)
    #define             IS_ANJUTA_ASYNC_COMMAND             (obj)
    #define             IS_ANJUTA_ASYNC_COMMAND_CLASS       (klass)
    #define             ANJUTA_ASYNC_COMMAND_GET_CLASS      (obj)
                        AnjutaAsyncCommandPriv;
                        AnjutaAsyncCommand;
    GType               anjuta_async_command_get_type       (void);
    void                anjuta_async_command_set_error_message
                                                            (AnjutaCommand *command,
                                                             gchar *error_message);
    gchar *             anjuta_async_command_get_error_message
                                                            (AnjutaCommand *command);
    void                anjuta_async_command_lock           (AnjutaAsyncCommand *self);
    void                anjuta_async_command_unlock         (AnjutaAsyncCommand *self);

## Object Hierarchy

      GObject
       +----AnjutaCommand
             +----AnjutaAsyncCommand

## Description

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.

## Details

### ANJUTA_TYPE_ASYNC_COMMAND

    #define ANJUTA_TYPE_ASYNC_COMMAND             (anjuta_async_command_get_type ())

### ANJUTA_ASYNC_COMMAND()

    #define ANJUTA_ASYNC_COMMAND(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_ASYNC_COMMAND, AnjutaAsyncCommand))

`obj` : |

### ANJUTA_ASYNC_COMMAND_CLASS()

    #define ANJUTA_ASYNC_COMMAND_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), ANJUTA_TYPE_ASYNC_COMMAND, AnjutaAsyncCommandClass))

`klass` : |

### IS_ANJUTA_ASYNC_COMMAND()

    #define IS_ANJUTA_ASYNC_COMMAND(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_ASYNC_COMMAND))

`obj` : |

### IS_ANJUTA_ASYNC_COMMAND_CLASS()

    #define IS_ANJUTA_ASYNC_COMMAND_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_ASYNC_COMMAND))

`klass` : |

### ANJUTA_ASYNC_COMMAND_GET_CLASS()

    #define ANJUTA_ASYNC_COMMAND_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), ANJUTA_TYPE_ASYNC_COMMAND, AnjutaAsyncCommandClass))

`obj` : |

### AnjutaAsyncCommandPriv

    typedef struct _AnjutaAsyncCommandPriv AnjutaAsyncCommandPriv;

### AnjutaAsyncCommand

    typedef struct _AnjutaAsyncCommand AnjutaAsyncCommand;

### anjuta_async_command_get_type ()

    GType               anjuta_async_command_get_type       (void);

Returns : |

### anjuta_async_command_set_error_message ()

    void                anjuta_async_command_set_error_message
                                                            (AnjutaCommand *command,
                                                             gchar *error_message);

`command` : |
`error_message` : |

### anjuta_async_command_get_error_message ()

    gchar *             anjuta_async_command_get_error_message
                                                            (AnjutaCommand *command);

`command` : |
Returns : |

### anjuta_async_command_lock ()

    void                anjuta_async_command_lock           (AnjutaAsyncCommand *self);

Locks the command's built-in mutex.

`self` : | AnjutaAsyncCommand object.

### anjuta_async_command_unlock ()

    void                anjuta_async_command_unlock         (AnjutaAsyncCommand *self);

Unlocks the command's built-in mutex.

`self` : | AnjutaAsyncCommand object.