TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sreejith s
NA
1
0
I need to know how Thread.Suspend and Thread.Resume replace with other available classes in.Net .My code is writen below . Thanks in Advance
Jun 15 2009 2:49 AM
public class Alpha { // This method that will be called when the thread is started public void Beta() { while (true) { try { Console.WriteLine("Alpha.Beta is running in its own thread."); Thread.CurrentThread.Suspend(); } catch { } } } }; public class Simple { public static int Main() { Alpha oAlpha = new Alpha(); Thread oThread = new Thread(new ThreadStart(oAlpha.Beta)); oThread.Start(); try { while (true) { if(oThread.ThreadState ==ThreadState.Suspended && oThread.IsAlive) oThread.Resume(); Thread.Sleep(1000); } } catch(Exception ex) { Console.WriteLine (ex.ToString ()); } return 0; } }
Reply
Answers (
0
)
c# looping
What if a method has a interface return type?