0
예를 들어 코드 실행을 지연시키기 위해 우분투 14.04와 Raspian (Raspberry Pi 2B)
에서 시스템 호출 "sleep"을 사용하려고했습니다. 5 초. 그러나 놀랍게도 Delay 내의 시스템 호출 "sleep"앞에있는 모든 코드는 런타임 중에 전혀 실행되지 않습니다. 시스템 호출 절전이 올바르게 작동하지 않습니다.
using System;
using Gtk;
using Mono.Unix.Native;
public partial class MainWindow: Gtk.Window
{
public MainWindow() : base (Gtk.WindowType.Toplevel)
{
Build();
entry1.Alignment = 0.5f;
// This code is not executed:
double result = Math.Pow (2.0, 2.0);
entry1.Text = result.ToString();
// End of code not executed
// Code executed:
Delay (5);
entry1.Text = "Button-A";
}
protected void OnDeleteEvent (object sender, DeleteEventArgs a)
{
Application.Quit();
a.RetVal = true;
}
private Int16 Delay (UInt32 value)
{
Mono.Unix.Native.Syscall.sleep (value);
return 0;
}
}
내가 리눅스의 기본적인 것들을 오해 또는 내가 컴파일러 오류에 직면하고 수행 여기에 문제의 원인이되는 간단한 코드는? 주제에 대한 힌트를 주셔서 감사합니다!