整理一下lock的特性。
1.lock的目標並不是物件,而是程式碼區段,只有被lock包覆的程式區段才會有作用。
目前分類:C# (87)
- Oct 28 Thu 2010 12:27
C# lock record
- Oct 27 Wed 2010 16:38
C# 取得傳來的byte資料 record
C# 取得傳來的byte資料
- Oct 27 Wed 2010 10:13
C# 父子視窗應用 record
private void button1_Click(object sender, EventArgs e)
{
- Oct 26 Tue 2010 14:32
C# 執行緒使用委派 record
跨執行緒呼叫控制項
在非同步概觀這篇文章提到如果在別的執行緒中直接操作Windows Form上的任何一個控制項,換句話說就是操作控制項的執行緒與建立控制項的執行緒並不是同一個,就會產生InvalidOperationException。這是.Net Framework中針對多執行緒工作所設下的一道安全性機制。
- Oct 26 Tue 2010 13:56
C# 時間轉字串格式 record
- Oct 26 Tue 2010 10:44
C# ListView record
this.listView1 = new System.Windows.Forms.ListView();
//
- Oct 26 Tue 2010 10:08
C# 開啟執行檔 record
C# 開啟執行檔
開啟執行檔
- Oct 12 Tue 2010 16:45
C# 常數 record
class Calendar1
- Sep 15 Wed 2010 17:19
C# 停止 record
- Sep 05 Sun 2010 11:16
用1-52數字表示撲克牌的每一張牌 record
用1-52數字表示撲克牌的每一張牌
- Aug 24 Tue 2010 21:17
C# 委派和事件
- Aug 23 Mon 2010 15:30
C# 取亂數 record
- Aug 22 Sun 2010 23:18
VB和C# 字串比較 record
VB pecial character constants (all also accessible from ControlChars class) |
- Aug 22 Sun 2010 20:45
C# 大樂透對獎程式
- Aug 22 Sun 2010 09:54
C# function 參數參照 record
// Pass by value (in, default), reference (in/out), and reference (out)
void TestFunc(int x, ref int y, out int z) {
- Aug 22 Sun 2010 09:50
C# 分隔分符串 record
class TestStringSplit { static void Main() { char[] delimiterChars = { ' ', ',', '.', ':', '\t' }; string text = "one\ttwo three:four,five six seven"; System.Console.WriteLine("Original text: '{0}'", text); string[] words = text.Split(delimiterChars); System.Console.WriteLine("{0} words in text:", words.Length); foreach (string s in words) { System.Console.WriteLine(s); } } }
- Aug 22 Sun 2010 00:12
C# 字串格式 record
- Aug 21 Sat 2010 22:46
C# 使用VB的Collection集合 record
1.First, add a reference to Microsoft.VisualBasic to your project. You can find the Microsoft.VisualBasic in the list on the .Net tab when you open the Add reference dialog.
- Aug 21 Sat 2010 21:37
C# 隨心所欲產生圖案 record
隨心所欲產生圖案