~ubuntu-branches/ubuntu/precise/icedtea-web/precise-proposed

« back to all changes in this revision

Viewing changes to plugin/icedteanp/IcedTeaJavaRequestProcessor.cc

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2011-06-09 10:39:20 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20110609103920-bwo1l3r8ic5g9uaa
Tags: 1.1~20110608-1ubuntu1
Rebuild the control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
247
247
    plugin_to_java_bus->post(message.c_str());
248
248
 
249
249
    // Wait for result to be filled in.
250
 
        struct timespec curr_t;
 
250
    struct timespec curr_t;
 
251
 
 
252
    bool isPluginThread = false;
 
253
 
 
254
    if (pthread_self() == itnp_plugin_thread_id)
 
255
    {
 
256
        isPluginThread = true;
 
257
        PLUGIN_DEBUG("JRP is in plug-in thread...\n");
 
258
    }
251
259
 
252
260
    do
253
261
    {
254
 
        clock_gettime(CLOCK_REALTIME, &curr_t);
255
 
 
256
 
                if (!result_ready && (curr_t.tv_sec < t.tv_sec))
257
 
                {
258
 
                        if (g_main_context_pending(NULL))
259
 
                                g_main_context_iteration(NULL, false);
260
 
                        else
261
 
                                usleep(200);
262
 
                }
263
 
                else
264
 
                        break;
265
 
 
 
262
        clock_gettime(CLOCK_REALTIME, &curr_t);
 
263
 
 
264
        if (!result_ready && (curr_t.tv_sec < t.tv_sec))
 
265
        {
 
266
            if (isPluginThread)
 
267
            {
 
268
                processAsyncCallQueue(NULL);
 
269
 
 
270
                // Let the browser run its pending events too
 
271
                if (g_main_context_pending(NULL))
 
272
                {
 
273
                    g_main_context_iteration(NULL, false);
 
274
                } else
 
275
                {
 
276
                    usleep(1000); // 1ms
 
277
                }
 
278
            } else
 
279
            {
 
280
                usleep(1000); // 1ms
 
281
            }
 
282
        }
 
283
        else
 
284
        {
 
285
            break;
 
286
        }
266
287
    } while (1);
267
288
 
268
289
    if (curr_t.tv_sec >= t.tv_sec)