Could be conflict due to two service intents to the same service?
<p>I just wonder whether there will be any conflict if two service intents are sent to the same service at the same time. My code is as below:</p>

<pre><code>public static class UpdateService extends Service {

    @Override
    public void onStart(Intent intent, int startId) {
        int widgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
                AppWidgetManager.INVALID_APPWIDGET_ID);

        UpdateThread updateThread = new UpdateThread();
        updateThread.mWidgetId = widgetId;
        updateThread.mContext = this;

        updateThread.start();

        stopSelf();
    }
}
</code></pre>

<p>Suppose there are two intents, intent 1 and intent 2, for UpdateService at the same time. As I understand, there will be only one UpdateService instance. Then, will the two intents cause the service code to run sequentially like the workflow below?</p>

<ol>
<li>UpdateService starts, i.e. onStart() is called, for intent 1.</li>
<li>UpdateService stops because stopSelf() is called in onStart().</li>
<li>UpdateService starts, i.e. onStart() is called, for intent 2.</li>
<li>UpdateService stops because stopSelf() is called in onStart().</li>
</ol>

<p>Could the two intents cause the service code, i.e onStart(), to run simultaneously? Do I need to put synchronized in the onStart() method definition?</p>

<p>Thanks.</p>
