moved init routines to be executed on node specific basis

This commit is contained in:
fros4943 2007-08-23 07:36:34 +00:00
parent 6d86b77cfe
commit 992a715ba6

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: contiki_template.c,v 1.4 2007/08/21 13:10:19 fros4943 Exp $
* $Id: contiki_template.c,v 1.5 2007/08/23 07:36:34 fros4943 Exp $
*/
/**
@ -106,7 +106,22 @@ static struct cooja_mt_thread process_run_thread;
static void
start_process_run_loop(void *data)
{
while(1)
/* Initialize random generator */
random_init(0);
/* Start process handler */
process_init();
/* Start Contiki processes */
procinit_init();
/* Initialize communication stack */
init_net();
/* Start user applications */
autostart_start((struct process **) autostart_processes);
while(1)
{
/* Always pretend we have processes left while inside process_run() */
simProcessRunValue = 1;
@ -144,21 +159,6 @@ extern unsigned long _end;
JNIEXPORT void JNICALL
Java_se_sics_cooja_corecomm_[CLASS_NAME]_init(JNIEnv *env, jobject obj)
{
/* Initialize random generator */
random_init(0);
/* Start process handler */
process_init();
/* Start Contiki processes */
procinit_init();
/* Initialize communication stack */
init_net();
/* Start user applications */
autostart_start((struct process **) autostart_processes);
/* Prepare thread that will do the process_run()-loop */
cooja_mt_start(&process_run_thread, &start_process_run_loop, NULL);
}