dev_lock() question

From: Divacky Roman (xdivac02_at_stud.fit.vutbr.cz)
Date: 09/29/05

  • Next message: Stanislav Sedov: "Re: dev_lock() question"
    Date: Thu, 29 Sep 2005 18:55:38 +0200
    To: hackers@freebsd.org
    
    

    Hi,

    dev_lock() looks this way:

    void
    dev_lock(void)
    {
            if (!mtx_initialized(&devmtx))
                    mtx_init(&devmtx, "cdev", NULL, MTX_DEF);
            mtx_lock(&devmtx);
    }

    I wonder why is the mtx_initialized checking necessary? shouldnt explicit
    initialization be sufficient?

    thnx for answer

    roman
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Stanislav Sedov: "Re: dev_lock() question"

    Relevant Pages