本文整理汇总了C++中queue_task函数的典型用法代码示例。如果您正苦于以下问题:C++ queue_task函数的具体用法?C++ queue_task怎么用?C++ queue_task使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了queue_task函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: jade_sched_event
void
jade_sched_event(struct BCState *bcs, int event)
{
bcs->event |= 1 << event;
queue_task(&bcs->tqueue, &tq_immediate);
mark_bh(IMMEDIATE_BH);
}
示例2: amd7930_dxmit_callback
static void
amd7930_dxmit_callback(void *arg, int error)
{
struct IsdnCardState *cs = (struct IsdnCardState *) arg;
static struct tq_struct task;
/* NOTE: This function is called directly from an interrupt handler */
/* may wish to do retransmission here, if error indicates collision */
if (cs->debug & L1_DEB_ISAC_FIFO) {
char tmp[128];
char *t = tmp;
t += sprintf(t, "amd7930 Dxmit cnt %d", cs->tx_skb->len);
if (error) t += sprintf(t, " ERR %x", error);
QuickHex(t, cs->tx_skb->data, cs->tx_skb->len);
debugl1(cs, tmp);
}
cs->tx_skb = NULL;
task.routine = (void *) DChannel_proc_xmt;
task.data = (void *) cs;
queue_task(&task, &tq_immediate);
mark_bh(IMMEDIATE_BH);
}
示例3: avmb1_card_ready
void avmb1_card_ready(avmb1_card * card)
{
__u16 appl;
card->cversion.majorversion = 2;
card->cversion.minorversion = 0;
card->cversion.majormanuversion = (card->version[VER_DRIVER][0] - '0') << 4;
card->cversion.majormanuversion |= (card->version[VER_DRIVER][2] - '0');
card->cversion.minormanuversion = (card->version[VER_DRIVER][3] - '0') << 4;
card->cversion.minormanuversion |= (card->version[VER_DRIVER][5] - '0') * 10;
card->cversion.minormanuversion |= (card->version[VER_DRIVER][6] - '0');
card->cardstate = CARD_RUNNING;
for (appl = 1; appl <= CAPI_MAXAPPL; appl++) {
if (VALID_APPLID(appl) && !APPL(appl)->releasing) {
B1_send_register(card->port, appl,
1024 * (APPL(appl)->rparam.level3cnt+1),
APPL(appl)->rparam.level3cnt,
APPL(appl)->rparam.datablkcnt,
APPL(appl)->rparam.datablklen);
}
}
set_bit(CARDNR(card), ¬ify_up_set);
queue_task(&tq_state_notify, &tq_scheduler);
printk(KERN_NOTICE "b1capi: card %d ready.\n", CARDNR(card));
}
示例4: hycapi_sendmsg_internal
static void
hycapi_sendmsg_internal(struct capi_ctr *ctrl, struct sk_buff *skb)
{
hycapictrl_info *cinfo = (hycapictrl_info *)(ctrl->driverdata);
hysdn_card *card = cinfo->card;
spin_lock_irq(&cinfo->lock);
#ifdef HYCAPI_PRINTFNAMES
printk(KERN_NOTICE "hycapi_send_message\n");
#endif
cinfo->skbs[cinfo->in_idx++] = skb; /* add to buffer list */
if (cinfo->in_idx >= HYSDN_MAX_CAPI_SKB)
cinfo->in_idx = 0; /* wrap around */
cinfo->sk_count++; /* adjust counter */
if (cinfo->sk_count >= HYSDN_MAX_CAPI_SKB) {
/* inform upper layers we're full */
printk(KERN_ERR "HYSDN Card%d: CAPI-buffer overrun!\n",
card->myid);
ctrl->suspend_output(ctrl);
}
cinfo->tx_skb = skb;
spin_unlock_irq(&cinfo->lock);
queue_task(&card->irq_queue, &tq_immediate);
mark_bh(IMMEDIATE_BH);
}
示例5: rb_mtp_thread_delete_track
void
rb_mtp_thread_delete_track (RBMtpThread *thread, LIBMTP_track_t *track)
{
RBMtpThreadTask *task = create_task (DELETE_TRACK);
task->track_id = track->item_id;
task->storage_id = track->storage_id;
queue_task (thread, task);
}
示例6: rb_mtp_thread_set_album_image
void
rb_mtp_thread_set_album_image (RBMtpThread *thread, const char *album, GdkPixbuf *image)
{
RBMtpThreadTask *task = create_task (SET_ALBUM_IMAGE);
task->album = g_strdup (album);
task->image = g_object_ref (image);
queue_task (thread, task);
}
示例7: schedule_task
/**
* schedule_task - schedule a function for subsequent execution in process context.
* @task: pointer to a &tq_struct which defines the function to be scheduled.
*
* May be called from interrupt context. The scheduled function is run at some
* time in the near future by the keventd kernel thread. If it can sleep, it
* should be designed to do so for the minimum possible time, as it will be
* stalling all other scheduled tasks.
*
* schedule_task() returns non-zero if the task was successfully scheduled.
* If @task is already residing on a task queue then schedule_task() fails
* to schedule your task and returns zero.
*/
int schedule_task(struct tq_struct *task)
{
int ret;
need_keventd(__FUNCTION__);
ret = queue_task(task, &tq_context);
wake_up(&context_task_wq);
return ret;
}
示例8: ctc_tty_transmit_status
static void
ctc_tty_transmit_status(ctc_tty_info *info)
{
if (ctc_tty_shuttingdown)
return;
info->flags |= CTC_ASYNC_TX_LINESTAT;
queue_task(&info->tq, &tq_immediate);
mark_bh(IMMEDIATE_BH);
}
示例9: plser_start_tx
static void plser_start_tx(struct uart_port *port, u_int nonempty, u_int from_tty)
{
if (nonempty) {
port->read_status_mask |= ST_TX_FULL | ST_CTS;
queue_task(&plser_task, &tq_immediate);
mark_bh(IMMEDIATE_BH);
}
}
示例10: rb_mtp_thread_remove_from_album
void
rb_mtp_thread_remove_from_album (RBMtpThread *thread, LIBMTP_track_t *track, const char *album)
{
RBMtpThreadTask *task = create_task (REMOVE_FROM_ALBUM);
task->track_id = track->item_id;
task->storage_id = track->storage_id;
task->album = g_strdup (album);
queue_task (thread, task);
}
示例11: rb_mtp_thread_add_to_album
void
rb_mtp_thread_add_to_album (RBMtpThread *thread, LIBMTP_track_t *track, const char *album)
{
RBMtpThreadTask *task = create_task (ADD_TO_ALBUM);
task->track_id = track->item_id;
task->storage_id = track->storage_id;
task->album = g_strdup (album);
queue_task (thread, task);
}
示例12: tpam_enqueue
/*
* Queue a message to be send to the card when possible.
*
* card: the board
* skb: the sk_buff containing the message.
*/
void tpam_enqueue(tpam_card *card, struct sk_buff *skb) {
dprintk("TurboPAM(tpam_enqueue): card=%d\n", card->id);
/* queue the sk_buff on the board's send queue */
skb_queue_tail(&card->sendq, skb);
/* queue the board's send task struct for immediate treatment */
queue_task(&card->send_tq, &tq_immediate);
mark_bh(IMMEDIATE_BH);
}
示例13: rb_mtp_thread_queue_callback
void
rb_mtp_thread_queue_callback (RBMtpThread *thread,
RBMtpThreadCallback func,
gpointer data,
GDestroyNotify destroy_data)
{
RBMtpThreadTask *task = create_task (THREAD_CALLBACK);
task->callback = func;
task->user_data = data;
task->destroy_data = destroy_data;
queue_task (thread, task);
}
示例14: ctc_tty_write
/* ctc_tty_write() is the main send-routine. It is called from the upper
* levels within the kernel to perform sending data. Depending on the
* online-flag it either directs output to the at-command-interpreter or
* to the lower level. Additional tasks done here:
* - If online, check for escape-sequence (+++)
* - If sending audio-data, call ctc_tty_DLEdown() to parse DLE-codes.
* - If receiving audio-data, call ctc_tty_end_vrx() to abort if needed.
* - If dialing, abort dial.
*/
static int
ctc_tty_write(struct tty_struct *tty, int from_user, const u_char * buf, int count)
{
int c;
int total = 0;
ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
if (ctc_tty_shuttingdown)
return 0;
if (ctc_tty_paranoia_check(info, tty->device, "ctc_tty_write"))
return 0;
if (!tty)
return 0;
if (!info->netdev)
return -ENODEV;
if (from_user)
down(&info->write_sem);
while (1) {
struct sk_buff *skb;
int skb_res;
c = (count < CTC_TTY_XMIT_SIZE) ? count : CTC_TTY_XMIT_SIZE;
if (c <= 0)
break;
skb_res = info->netdev->hard_header_len + sizeof(info->mcr) +
+ sizeof(__u32);
skb = dev_alloc_skb(skb_res + c);
if (!skb) {
printk(KERN_WARNING
"ctc_tty: Out of memory in %s%d write\n",
CTC_TTY_NAME, info->line);
break;
}
skb_reserve(skb, skb_res);
if (from_user)
copy_from_user(skb_put(skb, c), buf, c);
else
memcpy(skb_put(skb, c), buf, c);
skb_queue_tail(&info->tx_queue, skb);
buf += c;
total += c;
count -= c;
}
if (skb_queue_len(&info->tx_queue)) {
info->lsr &= ~UART_LSR_TEMT;
queue_task(&info->tq, &tq_immediate);
mark_bh(IMMEDIATE_BH);
}
if (from_user)
up(&info->write_sem);
return total;
}
示例15: jiq_print_tq
/*
* Call jiq_print from a task queue
*/
void jiq_print_tq(void *ptr)
{
if (jiq_print (ptr)) {
struct clientdata *data = (struct clientdata *)ptr;
if (data->queue == SCHEDULER_QUEUE)
schedule_task(&jiq_task);
else if (data->queue)
queue_task(&jiq_task, data->queue);
if (data->queue == &tq_immediate)
mark_bh(IMMEDIATE_BH); /* this one needs to be marked */
}
}