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

Ask A Question

Stats

  • Questions 513k
  • Answers 513k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There's probably a cleaner way, but a way that works… May 16, 2026 at 6:00 pm
  • Editorial Team
    Editorial Team added an answer Reflection.Emit is one way of generating IL at runtime... http://msdn.microsoft.com/en-us/library/8ffc3x75(v=VS.90).aspx… May 16, 2026 at 6:00 pm
  • Editorial Team
    Editorial Team added an answer There appears to be work in progress to allow granting… May 16, 2026 at 6:00 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Let's say that I have the following code that's run in one thread of
In the Application Delegate didFinishLaunching method, I am using the following code to build
I am trying to parse a C-function like tree expressions like the following (using
I use the following code in a asp.net website. On application init i call
I need help getting a Grease Monkey with JQuery Script to run on a
I have been able to create php function to determine a list of zip
I'm currently creating a very small form on my homepage using HTML and JavaScript.
I am writing an assembly function to be called from C that will call
An issue i faced while using the select was: When I click on the
I have a workspace with the following 3 projects: Library Tests GUI The tests

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.