-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
5,688 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const vscode = require('vscode'); | ||
const fs = require('fs'); | ||
const os = require('os'); | ||
|
||
const { Worker, isMainThread, parentPort } = require('worker_threads'); | ||
const path = require('path'); | ||
const { getConfig } = require('../support_files/config'); | ||
|
||
const { CREATE_LOGGER, raiseError, raiseInfo } = require('../support_files/log_utils.js'); | ||
const bg3mh_logger = CREATE_LOGGER(); | ||
|
||
const debug2 = vscode.commands.registerCommand('bg3-mod-helper.debug2Command', async function () { | ||
const config = getConfig(); | ||
const localizationPath = path.join(config.rootModPath, 'Localization'); | ||
let coreCount = os.availableParallelism(); | ||
|
||
raiseInfo(`half of your cpu's cores: ${coreCount / 2}`); | ||
|
||
|
||
if (isMainThread) { | ||
const testWorker = new Worker(__filename); | ||
|
||
console.log("in main thread"); | ||
|
||
testWorker.on('message', (msg) => { | ||
console.log(msg); | ||
}); | ||
} | ||
else { | ||
console.log("in worker thread"); | ||
parentPort.postMessage("hi"); | ||
} | ||
|
||
// after you are through with this command, the following line must be uncommented and the only thing left for this file to be considered cleaned up. | ||
// raiseInfo("hi dipshit :)"); | ||
|
||
|
||
}); | ||
|
||
module.exports = debug2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const { CREATE_LOGGER, raiseError, raiseInfo } = require('../support_files/log_utils.js'); | ||
const bg3mh_logger = CREATE_LOGGER(); | ||
|
||
const { parentPort } = require('worker_threads'); | ||
|
||
function test_func() { | ||
raiseInfo("hi dipshit :)"); | ||
return "hi dipshit :)"; | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.