Skip to content

Commit

Permalink
A couple of minor cleanups on the last commit
Browse files Browse the repository at this point in the history
 - Remove a redundant logger
 - Provide a getter for the ComputerCraft thread group. This allows us
   to monitor child threads within prometheus.
 - Replace a deprecated call with a fastutils alternative.
  • Loading branch information
SquidDev committed Nov 22, 2018
1 parent 0829506 commit 8ae65d1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ private void handleSoftAbort() throws LuaError
Tracking.addValue( m_computer, TrackingField.COROUTINES_DISPOSED, 1 );
}
} );
ComputerCraft.log.info( "Thread pool: " + coroutines );
} )
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public long get( TrackingField field )

synchronized( fields )
{
return fields.get( field );
return fields.getLong( field );
}
}

Expand Down
10 changes: 10 additions & 0 deletions src/main/java/dan200/computercraft/shared/util/ThreadUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ private ThreadUtils()
{
}

/**
* Get the base thread group, that all off-thread ComputerCraft activities are run on.
*
* @return The ComputerCraft group.
*/
public static ThreadGroup group()
{
return baseGroup;
}

/**
* Construct a group under ComputerCraft's shared group
*
Expand Down

0 comments on commit 8ae65d1

Please sign in to comment.