Last active
August 29, 2015 14:09
-
-
Save chrisber/16388792e6ead99fc0b0 to your computer and use it in GitHub Desktop.
#v8dotnet segmentation fault
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
using System; | |
using System.IO; | |
using System.Threading; | |
using V8.Net; | |
namespace SegmentationFault | |
{ | |
public class Alpha | |
{ | |
// This method that will be called when the thread is started | |
public void Beta() | |
{ V8Engine v8 = new V8Engine(); | |
String test = System.IO.File.ReadAllText ("/Build/Typescript/TypeScript/built/local/tsc.js"); | |
while (true) | |
{ | |
Console.WriteLine("Alpha.Beta is running in its own thread."); | |
} | |
} | |
} | |
class MainClass | |
{ | |
public static void Main (string[] args) | |
{ | |
//V8Engine v8 = new V8Engine(); | |
Alpha oAlpha = new Alpha(); | |
// Create the thread object, passing in the Alpha.Beta method | |
// via a ThreadStart delegate. This does not start the thread. | |
Thread oThread = new Thread(new ThreadStart(oAlpha.Beta)); | |
// Start the thread | |
oThread.Start(); | |
while (!oThread.IsAlive) { | |
} | |
Thread.Sleep(1); | |
try{ | |
oThread.Abort(); | |
}catch(Exception e){} | |
oThread.Join(); | |
Console.WriteLine(); | |
Console.WriteLine("Alpha.Beta has finished"); | |
Console.WriteLine ("Hello World!"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment