Check-in [eb184c0f8d]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add class to store static globals; Rename ClientTaskManager to TaskManager.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: eb184c0f8dba20a760408899b86fade6ee3dd7ca
User & Date: stephanie.gawroriski 2019-10-06 13:02:43
Context
2019-10-06
14:08
Add base for class file parser. check-in: f8963e6e2d user: stephanie.gawroriski tags: trunk
13:02
Add class to store static globals; Rename ClientTaskManager to TaskManager. check-in: eb184c0f8d user: stephanie.gawroriski tags: trunk
11:57
Move the task handler to its own class. check-in: bc2baaa634 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/klib/supervisor/cc/squirreljme/jvm/Bootstrap.java.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// ---------------------------------------------------------------------------

package cc.squirreljme.jvm;

import cc.squirreljme.jvm.lib.BootRom;
import cc.squirreljme.jvm.lib.BootRomLibrary;
import cc.squirreljme.jvm.task.ClientTask;
import cc.squirreljme.jvm.task.ClientTaskManager;
import cc.squirreljme.jvm.task.TaskSysCallHandler;

/**
 * This is the bootstrap entry point for the supervisor.
 *
 * @since 2019/05/25
 */
................................................................................
			
			// Spacer
			todo.DEBUG.note("");
			
			// Load system call handler
			TaskSysCallHandler.initTaskHandler(config);
			
			// Initialize the client task manager
			todo.DEBUG.note("Initializing task manager...");
			ClientTaskManager ctm = new ClientTaskManager();
			todo.DEBUG.note("Okay.");
			
			// Spacer
			todo.DEBUG.note("");
			
			// Start the initial task
			todo.DEBUG.note("Creating initial task...");
			ClientTask boot = ctm.newTask(
				BootRom.initialClasspath(__rombase, config),
				BootRom.initialMain(__rombase, config),
				config.loadStrings(ConfigRomType.MAIN_ARGUMENTS),







|







 







<
|
|
<
<
<
<







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
67
68
69
70
71
72
73

74
75




76
77
78
79
80
81
82
// ---------------------------------------------------------------------------

package cc.squirreljme.jvm;

import cc.squirreljme.jvm.lib.BootRom;
import cc.squirreljme.jvm.lib.BootRomLibrary;
import cc.squirreljme.jvm.task.ClientTask;
import cc.squirreljme.jvm.task.TaskManager;
import cc.squirreljme.jvm.task.TaskSysCallHandler;

/**
 * This is the bootstrap entry point for the supervisor.
 *
 * @since 2019/05/25
 */
................................................................................
			
			// Spacer
			todo.DEBUG.note("");
			
			// Load system call handler
			TaskSysCallHandler.initTaskHandler(config);
			

			// Get the task manager
			TaskManager ctm = Globals.getTaskManager();




			
			// Start the initial task
			todo.DEBUG.note("Creating initial task...");
			ClientTask boot = ctm.newTask(
				BootRom.initialClasspath(__rombase, config),
				BootRom.initialMain(__rombase, config),
				config.loadStrings(ConfigRomType.MAIN_ARGUMENTS),

Added runt/klib/supervisor/cc/squirreljme/jvm/Globals.java.































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.jvm;

import cc.squirreljme.jvm.task.TaskManager;

/**
 * This class contains all of the globals which are used by the supervisor.
 *
 * @since 2019/10/06
 */
public final class Globals
{
	/** Manager for tasks. */
	private static TaskManager _TASK_MANAGER;
	
	/**
	 * Not used.
	 *
	 * @since 2019/10/06
	 */
	private Globals()
	{
	}
	
	/**
	 * Gets the task manager.
	 *
	 * @return The task manager.
	 * @since 2019/10/06
	 */
	public static final TaskManager getTaskManager()
	{
		TaskManager rv = Globals._TASK_MANAGER;
		if (rv == null)
			Globals._TASK_MANAGER = (rv = new TaskManager());
		return rv;
	}
}

Name change from runt/klib/supervisor/cc/squirreljme/jvm/task/ClientTaskManager.java to runt/klib/supervisor/cc/squirreljme/jvm/task/TaskManager.java.

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
..
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import cc.squirreljme.jvm.lib.ClassPath;

/**
 * This manages multiple tasks.
 *
 * @since 2019/06/22
 */
public final class ClientTaskManager
{
	/** The maximum number of permitted tasks. */
	public static final int MAX_TASKS =
		15;
	
	/** The tasks which are available. */
	public final ClientTask[] tasks =
................................................................................
		1;
	
	/**
	 * Initializes the client task manager.
	 *
	 * @since 2019/06/22
	 */
	public ClientTaskManager()
	{
		// Setup a system task, it has no classpath and is always zero
		this.tasks[0] = new ClientTask(0, 0, new ClassPath());
	}
	
	/**
	 * Creates a new task.







|







 







|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
..
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import cc.squirreljme.jvm.lib.ClassPath;

/**
 * This manages multiple tasks.
 *
 * @since 2019/06/22
 */
public final class TaskManager
{
	/** The maximum number of permitted tasks. */
	public static final int MAX_TASKS =
		15;
	
	/** The tasks which are available. */
	public final ClientTask[] tasks =
................................................................................
		1;
	
	/**
	 * Initializes the client task manager.
	 *
	 * @since 2019/06/22
	 */
	public TaskManager()
	{
		// Setup a system task, it has no classpath and is always zero
		this.tasks[0] = new ClientTask(0, 0, new ClassPath());
	}
	
	/**
	 * Creates a new task.