Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 880553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:07:03+00:00 2026-05-15T12:07:03+00:00

I am using the following code to run a function in another thread: void

  • 0

I am using the following code to run a function in another thread:

void load (....)
{
    GIOSchedulerJob *job;
    g_io_scheduler_job_send_to_mainloop(job,(GSourceFunc)job_func,&param, g_free);
}

    gboolean job_func(GIOSchedulerJob *job, GSourceFunc func, gpointer user_data, GDestroyNotify notify)
    {       
        JobParam* job_param = (JobParam*)user_data; 
        build(job_param->widget, job_param->mw);
        return TRUE;
    }

But when I try to call g_io_scheduler_job_send_to_mainloop I get an error: g_io_scheduler_job_send_to_mainloop: assertion 'job != NULL' failed.

How can I initialize job, or can I fix the issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T12:07:04+00:00Added an answer on May 15, 2026 at 12:07 pm

    Since the is obviously related to your previous question C attempt to difference a generic pointer

    I’m going to say I think you’re using the GIO job mechanism wrong (and using it for the wrong reasons as well), if you give some more detail about what you are trying to do and WHY you want to do it async someone might be able to give you a better answer, if you’re still doing the same thing in build() you were before, that’s STILL a problem with your code, if you’re leaving things out of the code you posted, please put some comments in explaining vaguely what it would have been doing.

    You haven’t really given enough detail to give a proper answer. (and your code this time around seems to be LESS correct than last time)

    g_io_scheduler_job_send_to_mainloop is to push a bit of work that needs to be done on the main thread, as part of a job that is already in progress, the GIOSchedulerJob is passed to your load(); by GIO when you kick of some async work with g_io_scheduler_push_job(). For example load could be something like:

    gboolean load(GIOSchedulerJob *job, GCancellable *cancellable, gpointer user_data)
    {
        // load a bunch of data and stuff it into param, or wherever
    
        g_io_scheduler_job_send_to_mainloop(job,(GSourceFunc)job_func, &param, g_free);
        return TRUE;
    }
    
    gboolean job_func(gpointer user_data)
    {       
        JobParam* job_param = (JobParam*)user_data; 
        build(job_param->widget, job_param->mw);
        return TRUE;
    }
    

    But fundamentally you are using the API wrong, job_func() shouldn’t have the same type as g_io_scheduler_job_send_to_mainloop()

    Also this didn’t really need to be a new question, you could have edited your previous one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following line of code to run my php file that I
I am using MVC3. I am getting following error when I run code analysis.
I am using following code to show a spinning wheel: $(#loading) .hide() .ajaxStart(function(){ $(this).show();
I am using following code to get bitmap from url. This function is used
I am using the following code to show dynamic progress dialog : public void
I couldn't run following code using JDK 6. It throws an exception: Exception in
I have the following code to count and trigger some functions using jQuery: jQuery('#input_guideName').keyup(function(e)
I have one file with the following code: function fx=ff(x) fx=x; I have another
Using following code I try to get updated list of checkbuttons' corresponding text values,
I using following code: var search = 'test'; if ($('#sku').find(search) ){ //alert(search); $(document).find(search).css('color','red'); <TABLE>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.